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

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

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>)
 >Applescript to set image in Addressbook (From: "Sutapalli Satyanarayana" <email@hidden>)

  • Prev by Date: Re: Applescript to set image in Addressbook
  • Next by Date: Re: Is this a bug?
  • Previous by thread: vcard in Addressbook
  • Next by thread: Re: Get List of window PC's in the network
  • Index(es):
    • Date
    • Thread