Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Applescript > Re: Adding imag...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 7 Topic 1601 of 1611
Post > Topic >>

Re: Adding images to Address Book people.

by Jason8 <jason.leach@[EMAIL PROTECTED] > Apr 27, 2008 at 10:06 AM

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.




 7 Posts in Topic:
Adding images to Address Book people.
Jason8 <jason.leach@[E  2008-04-24 17:55:38 
Private Message
   2008-04-24 18:28:42 
Private Message
   2008-04-24 21:06:45 
Re: Adding images to Address Book people.
Jason8 <jason.leach@[E  2008-04-25 10:12:09 
Re: Adding images to Address Book people.
Jolly Roger <jollyroge  2008-04-25 18:37:27 
Re: Adding images to Address Book people.
Jason8 <jason.leach@[E  2008-04-27 10:06:44 
Re: Adding images to Address Book people.
Jolly Roger <jollyroge  2008-04-27 14:00:23 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 0:54:04 CDT 2008.