Outlook for Mac

Assigning pictures to Outlook contacts via Applescript

待回答 0 个回答

较早的帖子,发布于 2014年2月3日。 其中的信息可能已经过时。

本帖暂无中文翻译,以下为英文原文。

问题 提问于 2014年2月3日

How would I go about assigning a picture to a new Outlook contact in Applescript? The Outlook dictionary tells me that Outlook does have an image class, but I have no clue how to populate one. It doesn't seem to like just being given what the finder thinks is a Jpeg file:

tell application "Finder"              
    set theImageFile to a reference to file "/path/to/mypicture.jpg" 
--set theImageFilePosixPath to POSIX file "/path/to/mypicture.jpg" set filekind to (kind of theImageFile) as string display dialog "its a" & filekind--displays "its a jpeg" end tell tell application "Microsoft Outlook" make new contact with properties {first name:"some", last name:"one", image:theImageFile, email addresses:{{address:"*** Email address is removed for privacy ***", type:work}, {address:"*** Email address is removed for privacy ***", type:home}}} end tell

Result: error "„«class docf» \"image-151718-galleryV9-zhek.jpg\" of «class cfol» \"Pictures\" of «class cfol» \"maximiliantyrtania\" of «class cfol» \"Users\" of «class sdsk» of application \"Finder\"“ kann nicht in den erwarteten Typ umgewandelt werden." number -1700 from «class docf» "image-151718-galleryV9-zhek.jpg" of «class cfol» "Pictures" of «class cfol» "maximiliantyrtania" of «class cfol» "Users" of «class sdsk»

I may have to create an Image from NSData then, but I'd be curious to see how this is done.


暂无回答

撰写回答

您的邮箱地址不会被公开。请勿发布密码。

This site uses Akismet to reduce spam. Learn how your comment data is processed.