Re: uh, that's so cool! AS 1.9.1
Re: uh, that's so cool! AS 1.9.1
- Subject: Re: uh, that's so cool! AS 1.9.1
- From: "Chris Espinosa" <email@hidden>
- Date: Fri, 20 Dec 2002 15:30:24 -0800
"Mike Fischer" <email@hidden> wrote:
>
I admit I haven't installed 10.2.3 or the new developer tools yet and I
>
haven't yet looked at any documentation for this but one question
>
immediatly comes to my mind:
>
>
How are localized names handled?
>
>
For example would I have to write:
>
>
if my do_menu("Finder", "Finder", "Andere ausblenden") is false then
>
error number -128
>
if my do_menu("Finder", "Darstellung", "Aufrdumen") is false then error
>
number -128
>
>
on a German system?
>
>
Or is there a general way to access the UI-Elements without localizing
>
the strings in the AppleScript?
>
>
Localizing the strings in the AS would be possible using a bundled
>
AppleScript Studio application of course but it seems like a waste to
>
have to recreate information already present in the bundled target app
>
in the script application.
>
>
Am I asking too much? Or am I missing something?
Good news and bad...
The bad is that the underlying system functionality (new in Jaguar) that
makes this possible does not store or reveal the "unlocalized" names of any
elements. So scripts that use names to refer to menus, butons, fields, etc.
must use the local-language name. As you point out you can use the localized
string feature of AppleScript Studio to make this easier, but in general a
compiled script that uses names in one language will fail on systems that
aren't set to that language.
The good news is that every element is accessable by index as well as name,
and in most cases the index doesn't change from one run of the application
to another. So you could rewrite the "my do_menu" subroutine above to take
index numbers instead of strings. It's more tedious to write and harder to
read, but much more portable.
Chris
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.