In article
<a2356771-722f-4842-a84f-362838edff35@[EMAIL PROTECTED]
>,
Jason8 <jason.leach@[EMAIL PROTECTED]
> wrote:
> That worked well, I was able to read in the file no problem. I guest
> Apple uses a proprietary or undocumented format for the image data in
> the Address Book. You can't just throw in a JPEG or TIFF. The image
> files are kept in Library/Application Support/AddressBook/Images and
> you can view them.
>
> Funny thing is I can take the image of one person and add it to a
> second person. But I can't read in a raw image file and add it. Later
> I'll try to strip away the JPEG or TIFF headers and load only the data
> portion.
I doubt that will be successful.
Have you used the Script Editor > File > Open Dictionary command to look
at the dictionaries of Image Events and Address Book? Something tells me
you haven't - mostly of the way you're writing this script.
For instance, if you run this short script, you'll see that the class of
data you get from the Image Events "open" command is "image":
set imageFile to choose file
tell application "Image Events"
set imageObject to open imageFile
get class of imageObject
end tell
If you look in the Image Events dictionary, you see that Image Events
has its own "image" class with a slew of properties.
Note that the Address Book dictionary has no such "image" class. The
class listed for the "image" property of the "person" class in Address
Book is "TIFF picture" - not "image". That tells me Address Book
probably will not know what this "image" class object is when you hand
it to Address Book.
Ignoring that, another problem could be the way you are trying to set
the picture. I think, rather than using "set", I would probably try to
do it like this:
tell app "Address Book"
add imageData to person "Firstname Lastname"
end tell
--
Please send all responses to the relevant news group. E-mail sent to
this address may be devoured by my very hungry SPAM filter. I do not
read posts from Google Groups. Use a real news reader if you want me to
see your posts.
JR


|