I’m stuck as to why this script isn’t working. The selections all work (which will ultimately fill in the body of the message). There are two things wrong:
-
the subject result has parentheses around it, which I don’t want.
-
More importantly, the “to” field will not get filled in and AS returns the error “Mail got an error: NSContainerSpecifierError”
Here’s the script:
set listRoom to {"Shaughnessy", "Garcia", "7013", "Events", "AV Loaner"}
set theRoom to choose from list listRoom with prompt "Which calendar would you like to add an event to?"
set theGroup to text returned of (display dialog "Enter the Office or Group that will be holding this event" default answer ("Front Office, Press Conference"))
set theContact to text returned of (display dialog "Enter a contact name and number for this event" default answer ("Montgomery Burns, x12345"))
set theDate to text returned of (display dialog "Enter date as mm/dd/yyyy" default answer (short date string of (current date)))
set the StartTime to text returned of (display dialog "Enter start time as hh:mm:ss AM" default answer (time string of (current date)))
set endTime to text returned of (display dialog "Enter end time as hh:mm AM" default answer (time string of (current date)))
set thePeople to text returned of (display dialog "How many people will be attending this event?" default answer "10")
set theNotes to text returned of (display dialog "Enter any notes for the event:" default answer " ")
set theRecipient to "email@mail.com" as text
tell application "Mail"
activate
set newMessage to make new outgoing message with properties {content:theGroup, subject:theRoom, visible:true}
tell newMessage
make new to recipient at end of to recipients with properties {name:"ICE TV", address:theRecipient}
end tell
end tell
Thoughts? I’ll keep digging in the meantime…
Thanks,
Mike
Model: Mac Pro, Octo
AppleScript: 1.10.7
Browser: Firefox 2.0.0.11
Operating System: Mac OS X (10.4)