Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

292
Views
Google App Scripts Method to Create a Shortcut to Google Drive File

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"

enter image description here

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.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

When you want to create a shortcut of the file aFile to the folder of theFolder, how about the following modified script?

Modified script:

function makeSomeFileLink(){
  var theFolder = DriveApp.getFolderById("wdflasdjflaskdjfklsadjflk");
  var aFile = DriveApp.getFileById("1VjOkMPBDr???????????qkZqPCQWOvBbIt_6GawA");
  DriveApp.createShortcut(aFile.getId()).moveTo(theFolder);
}
  • Of course, in this case, you can directly put the file ID of "1VjOkMPBDr???????????qkZqPCQWOvBbIt_6GawA" to createShortcut.

Reference:

  • createShortcut(targetId)
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!