Re: Applescript to set image in Addressbook
Re: Applescript to set image in Addressbook
- Subject: Re: Applescript to set image in Addressbook
- From: Philip Aker <email@hidden>
- Date: Mon, 16 Mar 2009 01:17:35 -0700
On 2009-03-15, at 05:12:51, Sutapalli Satyanarayana wrote: Can some body tell me how to set an image of a person in Address Book.
The Address Book image for a person takes a 'TIFF picture' data value.So you have to read the file into a variable as an object of that class specifically.
set ipath to (path to desktop as text) & "TigerWoods.tiff"set idata to missing value
try set f to open for access ipath set idata to read f as TIFF picture close access f on error errs number errn try close access f end try end try
tell application "Address Book" set pers to item 1 of (get every person whose first name is "Tiger" and last name is "Woods") if (exists image of pers) then beep else set image of pers to idata end if save addressbook end tell
Philip Aker echo email@hidden@nl | tr a-z@. p-za-o.@ Democracy: Two wolves and a sheep voting on lunch. |
_______________________________________________
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