You are not logged in.
"HELP!" -- The Beatles
Using Applescript to control your applications is both fun and useful, but finding the information you need to write those scripts can be trying. Many scripters are mystified by application dictionaries and rely instead on help from other coders or other scripts to "show them the way." When you need a script to work quickly, waiting for a response from another scripter can seem to take forever. There is, however, a quicker way to get the help you need - Applescript dictionaries. Here, for your scripting pleasure, is a tutorial to help you make sense of an application's dictionary, the collected information about what an application will give you access to.
One way of opening a dictionary is to use the Open Dictionary item in the File menu of Script Editor. When you use this item, you will get a listing of the available applications that have dictionaries. Choose one and click the Open button or use the Browse button to navigate to an unlisted application.
Another way to open a dictionary, particularly if it is one you use frequently, is to make use of Script Editor's Library window. It's located in the Window menu below the Result History and Event Log History menu items. The Library window shows a list of default applications whose dictionaries you can open with a double click or by selecting it and clicking the Open Library toolbar item. By adding items to the library window that you use frequently you can customize the list so that it helps you get to the information you need quickly.
Applescript:
tell application "Address Book"
set myNewGroup to make new group with properties {name:"New group"}
end tell
Items in the dictionary that have a square icon with a "C" in it are classes, which means they define objects that can be created or manipulated. Here's another dictionary entry, this time for the "group" class in the Address Book dictionary.
Nitewing '98
--
I distrust morning people, largely because I suspect them of getting together early one day while the rest of us were asleep and setting up the rules of civilization.
Offline