Re: List all the app-defined keywords?
Re: List all the app-defined keywords?
- Subject: Re: List all the app-defined keywords?
- From: Christopher Nebel <email@hidden>
- Date: Sat, 1 Aug 2009 12:07:17 -0700
On Aug 1, 2009, at 2:05 AM, Emmanuel LEVY wrote:
On Jul 31, 2009, at 10:38 PM, David Springer wrote:
tell application "Some App"
set keylist to keywords of application
return keylist
end tell
Is there a way to do this? How?
I think that most of the scriptable apps contain their AppleScript
dictionary as an XML file in theapp.app/Contents/Resources/.
I found such a file in Smile: Smile.sdef.
I found two such files in Mail: Mail.scriptSuite and
Mail.scriptTerminology.
Maybe someone more knowledgeable can tell more precisely.
Any scriptable application has its dictionary embedded in the
application, but there are three different formats it could be in.
However, there's a tool that will extract any of them as an sdef (the
most modern format; man 5 sdef for details), so if you don't mind a
bit of command-line magic:
% sdef /Applications/Mail.app | perl -ne 'print "$_\n" foreach /
name="([^"]+)"/g' | sort -dfu
The sdef(1) bit gets the application scripting interface as an sdef,
the perl(1) bit pulls out all the "name" attributes, which is where
all the scriptable terms are (plus a bit of other extraneous stuff
such as suite names; this isn't perfect), and finally the sort(1) bit
puts them all in alphabetical order.
--Chris Nebel
AppleScript Engineering
_______________________________________________
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