Reputation: 86
I'm getting
Cannot find method makeCopy(string,Folder)
when I try to make a copy of a file. https://developers.google.com/apps-script/reference/drive/file#makeCopy(String,Folder) clearly states that makeCopy(string,Folder) works fine. I am confused, any help?
Upvotes: 1
Views: 1906
Reputation: 46812
In the reference you show the method belongs to the DriveApp service, you are using DocsList service and the latter does not have such a method.
That's why you are getting this message.
Use DriveApp to get your file and it will work.
I would also suggest to make use of the autocompletion feature of the script editor to avoid such problems, it will automatically suggest all the possible methods that apply to the object you are working with, very comfortable ;)
(use control|space to call the autocomplete)
Upvotes: 2