I am trying to make code in Applescript that makes a new contact with already filled in information. Here is my code:
set contactFirstName to "Brandon"
set contactLastName to "Damante"
set contactStreet to "7688 Somerly Ct"
set contactCity to "New Albany"
set contactCountry to "USA"
set contactZip to "43054"
set contactEmail to "chocolatecheese101@hotmail.com"
set contactNote to "I'm Awesome"
set contactState to "Ohio"
--Address Book Tell Block
tell application "Address Book"
--Create the Contact
set theContact to make new name with properties {first name:contactFirstName, last name:contactLastName, street:contactStreet, city:contactCity, state:contactState, country:contactCountry, zip:contactZip, email:contactEmail, note:contactNote}
end tell
it highlights the bolded part and says, “Can’t make application ‘Address Book’ into type location reference,” and I’ve never seen that error message before. What does that mean to my code? How can i correct it?
Try this: