Skip to main content
Frans v.d. Geest
Community Expert
Community Expert
March 13, 2017
Answered

Targeting Select All menu language independent

  • March 13, 2017
  • 1 reply
  • 1405 views

I have a script that adds a menu under the Select All menu.

But I can not target the menu language independent.

I tried "Select_All", "SelectAll' and even "Select All" but it does not work in other languages.
I'm using a Dutch install. When I insert 'Clear' it does add under 'Wissen' in the Dutch version (Wissen=Clear)

Now I'm using this:

var fileMenu = app.menus.item("$ID/Main").submenus.item("$ID/&Edit");

var refItem = fileMenu.menuItems.item("Alles selecteren");

Alles Selecteren is the Dutch entry for Select All, but I want to make this work in any language.

Does anyone know what to target as $ID here?

Thanks!

This topic has been closed for replies.
Correct answer Laubender

Hi Frans,

Use: $ID/Select &All

Why?

var title = app.menus.item("$ID/Main").

submenus.item("$ID/&Edit").

menuItems.item("Alles selecteren").

title;

app.findKeyStrings(title);

// $ID/Select &All

Best look after the title of a menu item for feeding a special method that comes with app.

The name could be not reliable enough.

Regards,
Uwe

1 reply

LaubenderCommunity ExpertCorrect answer
Community Expert
March 13, 2017

Hi Frans,

Use: $ID/Select &All

Why?

var title = app.menus.item("$ID/Main").

submenus.item("$ID/&Edit").

menuItems.item("Alles selecteren").

title;

app.findKeyStrings(title);

// $ID/Select &All

Best look after the title of a menu item for feeding a special method that comes with app.

The name could be not reliable enough.

Regards,
Uwe

Frans v.d. Geest
Community Expert
Community Expert
March 13, 2017

Thanks Uwe!

The 'why': I reused part od a script I know works (it set a var as menu title used later).

I am no scriptet, just making little steps here ;-)

Community Expert
March 13, 2017

Hi Frans,

you are welcome.

As you know I am working with the German version of InDesign.
My customers could work in virtually all localized versions.

So I always try to find the string that works for all if I have to work with menu items and scripting.

app.findKeyStrings()

will produce the ones.
If there is one.

And sometimes it produces two or more strings.

Then you have to test all one after another to find the appropriate one.

In my German version of InDesign I could ask the menu its name or title.

var name =

app.menus.item("$ID/Main").

submenus.item("$ID/&Edit").

menuItems.item("Alles auswählen").name;

var name =

app.menus.item("$ID/Main").

submenus.item("$ID/&Edit").

menuItems.item("Alles auswählen").title;

Returned are

name : "Alles auswählen"

title : "Alles ausw&ählen"

If I run:

app.findKeyStrings("Alles auswählen");

nothing will returned.

Wheras if I run:

app.findKeyStrings("Alles ausw&ählen");

$ID/Select &All will returned.

Regards,
Uwe