Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

298
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda