Q: Mac Mail AppleScript Help
I am using this script with 10.10 and I am unable to use in with 10.11 and above. In 10.11 it creates the account, but once the mail app closes it disappears and in 10.12 it does nothing that I can see in the mail preferences.
Is there another way to add a mail account or even an internet account?
Any help would be greatly appreciated.
--Non-Working Chunk--
tell application "Mail" to quit
set First1 to the text returned of (display dialog "What is your First Name?" default answer "" buttons {"Cancel", "Next"} default button 2)
set Last1 to the text returned of (display dialog "What is your Last Name?" default answer "" buttons {"Cancel", "Next"} default button 2)
set theUsername to the text returned of (display dialog "What is your e-mail address?" default answer "" buttons {"Cancel", "Next"} default button 2)
set thePassword to the text returned of (display dialog "What is your password?" default answer "" buttons {"Cancel", "Next"} default button 2 with hidden answer)
-- Variables
set outgoing_server to "smtp.gmail.com"
set outgoing_port to "587"
set incoming_server to "imap.gmail.com"
set incoming_port to "993"
set theFullName to First1 & " " & Last1 & " "
-- Build IMAP Gmail Account
tell application "Mail"
set AccountName to First1 & " " & Last1 & " "
set newacct to make new imap account with properties {name:AccountName, user name:theUsername, port:incoming_port, uses ssl:true, authentication:("axct" as constant), server name:incoming_server}
tell newacct
set password to thePassword
set full name to AccountName
set email addresses to theUsername
end tell
set mysmtp to make new smtp server with properties {server name:outgoing_server, port:outgoing_port, uses ssl:true, authentication:("axct" as constant), user name:theUsername, name:"Google"}
tell mysmtp
set password to thePassword
end tell
set smtp server of newacct to mysmtp
end tell
Posted on Sep 14, 2016 7:44 PM