Re: names of a record's items
Re: names of a record's items
- Subject: Re: names of a record's items
- From: Shane Stanley <email@hidden>
- Date: Thu, 10 Apr 2014 23:48:26 +1000
On 10 Apr 2014, at 11:11 pm, 2551 <email@hidden> wrote:
> Is there any way to back-translate these to the property names? Or to ask the question in another way, where do I find the dictionary for the codes? I know they are listed in the AppleScript Terminology & Event Codes document, but is there a way I can find and access them on-the-fly at run time? I suppose I could write my own dictionary, but it’s always going to be out of date from what’s actually on the user's system (and indeed the codes in that document are from 2006 anyway).
You can collect the codes by looping through all scripting additions and calling OSACopyScriptingDefinition(), building an XMLDocument from each, and then parsing the XML. OSAGetSysTerminology() will probably get you the AS component values somehow. But you're assuming all record properties are from standard additions -- what about others?
Anyway, it sounds like the road to early madness.
If you have the record as an NSAppleEventDescriptor, you can use OSACopyDisplayString(), probably using kOSAModeDisplayForHumans. You'll need to set the context if it's not a record from an addition.
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden