I’m trying to automate the process of creating a shortcut/link to a Google file as one would manually do by right-clicking on a file and seeing the below screen and clicking “Add shortcut to Drive”
Looking through Google’s Documentation on file
object shows no actionable methods of this feature, only pulls (i.e. getTargetId()
, etc).
I’m pretty sure this isn’t available but I thought I’d throw it out there and see if anyone had any ideas. I see a couple posts using some external API’s and firefox which isn’t what I’m trying to do.
If I were to guess what code such code would look like, it would be something like this….
function makeSomeFileLink(){
var theFolder = DriveApp.getFolderById("wdflasdjflaskdjfklsadjflk")
var aFile = DriveApp.getFileById("1VjOkMPBDr???????????qkZqPCQWOvBbIt_6GawA");
var myNewBookMark = aFile.makeShortCutAndPutInInThisFolder(theFolder);
}
Obviously, that last row of code is problematic (i.e. I made it up), I’m just trying to illustrate what I’m looking for.
Any meaningful or entertaining feedback will get upvoted. Thanks.