On Apr 25, 4:37=A0pm, Jolly Roger <jollyro...@[EMAIL PROTECTED]
> wrote:
> In article
> <a2356771-722f-4842-a84f-362838edf...@[EMAIL PROTECTED]
>,
>
> =A0Jason8 <jason.le...@[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"
> =A0 =A0 =A0set imageObject to open imageFile
> =A0 =A0 =A0get 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"
> =A0 =A0 =A0add 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
Tanks JR. That was helpful.I found the by using your code to get the
class of an object that the class from a TIFF I read in was
'image' (as expected) and the type from the Address Book was 'TIFF
picture'. I 'll research how to make the conversion today. I also
tried to add as you suggest, and AB did accept it but did nothing with
the image nor threw an error. More work to do.


|