问题
I'm trying to create an Outlook contact via Applescript. The script looks like this:
tell application "Microsoft Outlook" to make new contact with properties {first name:"test1", last name:"test2", email addresses:{{address:"work@mywork.com", type:work}, {address:"home@myhome.com", type:home}}}
The Outlook dictionary tells me that I got the class name ("contact") and the field names right. But upon saving the script I'm told: expected class name, but got property and the first "name" is highlighted. Strangely enough this error goes away if I remove the space between "first" and "name" (and "last" and "name"). Then I can save it, but upon executing I get this: error "The variable „contact“ is not defined." number -2753 from "contact" (my translation, the original error message is in german). I'm using Outlook 2011 (v14.3.9 on Mavericks). What might be up there?
回答1:
Your script works. Try looking somewhere else in the script. Paste the snippet above into a new script and test it yourself.
来源:https://stackoverflow.com/questions/21478707/creating-outlook-contacts-via-applescript