• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AppleScript and shell scripting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: AppleScript and shell scripting
      • From: Michelle Steiner <email@hidden>
References: 
 >Re: AppleScript and shell scripting (From: Ed Stockly <email@hidden>)
 >Re: AppleScript and shell scripting (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: AppleScript-Users Digest, Vol 4, Issue 354
  • Next by Date: Re: GUI Scripting to toggle "Announce Time"?
  • Previous by thread: Re: AppleScript and shell scripting
  • Next by thread: Re: AppleScript and shell scripting
  • Index(es):
    • Date
    • Thread