• 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
Applescript to set image in Addressbook
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Applescript to set image in Addressbook


  • Subject: Applescript to set image in Addressbook
  • From: "Sutapalli Satyanarayana" <email@hidden>
  • Date: Sun, 15 Mar 2009 06:12:51 -0600

Can some body tell me how to set an image of a person in Address Book.

I am trying the following script, but couldn't set it.


tell application "Address Book"

set the_people to every person in group "Work" whose last name = "Ravi"  --Persons with "Ravi" as last name don't have an image in address book

repeat with this_person in the_people

if image of this_person exists then  --Check if the image exists or not

display dialog "Photo Exists"

else

--set img_name to alias "MacintoshHD:Users:johnny:Desktop:myimage.jpg"

set img_name to POSIX path of "/Users/johnny/Desktop/myimage.jpg"

set image of this_person to img_name

save addressbook

end if

end repeat

end tell


The error I am getting is "Address Book got an error: Can't make "/Users/johnny/Desktop/myimage.jpg" into type TIFF picture."


I converted myimage.jpg to myimage.tif using GIMP.  I even tried with myimage.tif but same above error is repeated.


Can some body help me in achieving this.


Thanks & Regards,

Satyam.

 _______________________________________________
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 to set image in Addressbook
      • From: Philip Aker <email@hidden>
    • Re: Applescript to set image in Addressbook
      • From: "email@hidden" <email@hidden>
References: 
 >Re: Get List of window PC's in the network (From: "Knight, William H. (NIH/OD) [C]" <email@hidden>)
 >Re: Get List of window PC's in the network (From: Roger Howard <email@hidden>)
 >Re: Get List of window PC's in the network (From: Roger Howard <email@hidden>)

  • Prev by Date: Re: Re. third-party dependencies [was Re: Stock Quotes using AppleScript]
  • Next by Date: Re: Re. third-party dependencies [was Re: Stock Quotes using AppleScript]
  • Previous by thread: Re: Get List of window PC's in the network
  • Next by thread: Re: Applescript to set image in Addressbook
  • Index(es):
    • Date
    • Thread