Re: AppleScript and shell scripting
Re: AppleScript and shell scripting
- Subject: Re: AppleScript and shell scripting
- From: "Mark J. Reed" <email@hidden>
- Date: Sun, 29 Jul 2007 14:51:54 -0400
On 7/29/07,
Michelle Steiner <
email@hidden> wrote:
How would you add an email address to a contact (AKA: person) in the
Address Book using perl or tcsh?
Here is how to do it with Applescript:
tell application "Address Book"
tell item 1 of (get the selection) to make new email with properties
{label:"home", value:"email@hidden"}
save addressbook
end tell
And until you told me that, I would have had absolutely no idea. I believe that's the whole point: the alleged transparency of AppleScript is a fallacy brought on by familiarity.
Now, I could do that in Perl - now that you've shown me the events, properties, etc involved - using Mac::Glue, or Mac::AppleScript::Glue, or Apple::Events::Simple, or something, but that would be silly. Scripting Mac applications is what AppleScript is for, and I don't see any reason to do that in any other language. Similarly, I don't see anything wrong with using the shell to do what it does best.
--
Mark J. Reed <
email@hidden>
_______________________________________________
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