0

This methode is Obsolete

How to acces directely and open a drive document by menu URL or ID ?

function onOpen() {
  // Add a menu with some items, some separators, and a sub-menu.
      DocumentApp.getUi().createMenu('OAR')

      .addItem('MAJ  Date + OAR', 'test')
      .addItem('MAJ  Date  Auto', 'testdate')
     ***.addItem('Accès Direct URL', 'href=/d/1udvLSpaZNgalg6NId JMJvkkw3i9oCaEKa-A_CAC79CYkvsZKD545dyZN/edit?')***

       .addToUi();
}
Lolowr
  • 81
  • 1
  • 3
  • 9
  • Thanks Serge .I don't want to use widget .I want to open an url "URL" by menu + function on my googledoc document . One click to find ID of Active document and open an URL ( always the same document googledoc document on the drive) write a variable "a phrase of the active document" on the new document open "URL" – Lolowr Jun 24 '14 at 21:10
  • You should comment on my answer if you want me to be notified...that said, anchor widget is the only way to create a link: a sidebar or a pop up... – Serge insas Jun 24 '14 at 21:18

1 Answers1

0

You can't do it from a menu item.

But you can do it from a sidebar that can automatically be opened with your document of from a popup triggered by a menu call.

Use UiApp anchor widget (plenty of examples around here...)

Serge insas
  • 45,904
  • 7
  • 105
  • 131