[GastForen

  • Suche
  • Hilfe
  • Lesezeichen
  • Benutzerliste
Forenindex -- Lesezeichen

2 Lesezeichen für international

Eventskrips für CS3
Zitat aber Herr Singelmann hat gesagt

Holy smoke! Bitte meißelt meine Worte nicht in Marmor. Wenn überhaupt meißeln, dann in Vanillepudding, da kriegt man sie wenigstens wieder raus.

Ich habe nur den Scripting Guide zitiert (zu laden unter http://www.adobe.com/...scripting/index.html in der Mitte auf "Scripting resources" klicken), weil ich es plausibel finde, auch diesen Part unser Scripte sprachneutral zu halten.

Dort steht
Zitat in InDesign scripting, menuItems, menus, menuActions,and submenus are all referred to by name. Because of this, scripts need a method of locating these objects that is independent of the installed locale of the application. To do this, you can use an internal database of strings that refer to a specific item, regardless of locale

und
Zitat Note:It is much better to get the locale-independent name of a menuAction than of a menu, menuItem, or submenu, because the title of a menuAction is more likely to be a single string. Many of the other menu objects return multiple strings when you use the getKeyStrings method.


Das Beispielscript im Guide zum finden des neutralen Strings ist
Code
var myString = ""; 
var myMenuAction = app.menuActions.item("Convert to Note");
var myKeyStrings = app.findKeyStrings(myMenuAction.name);
if(myKeyStrings.constructor.name == "Array"){
for(var myCounter = 0; myCounter < myKeyStrings.length; myCounter ++){
myString += myKeyStrings[myCounter] + "\r";
}
}
else{
myString = myKeyStrings;
}
alert(myString);


Um daraus die momentan aktuelle Sprache zu machen
Code
var myString = app.translateKeyString("$ID/NotesMenu.ConvertToNote"); 


So, jetzt ist alles wieder schön relativiert und eingeebnet :)

Danke
...
Gerald Singelmann
28. Jun 2007, 23:09
Gerald Singelmann
15. Apr 2008, 12:56