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.
|