• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Apple Mail 3.5: Changing Mail Server Settings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Apple Mail 3.5: Changing Mail Server Settings


  • Subject: Re: Apple Mail 3.5: Changing Mail Server Settings
  • From: "Jeremy W. Sherman" <email@hidden>
  • Date: Wed, 22 Apr 2009 23:47:56 -0400

Even after injecting F-Script Anywhere into Mail.app and poking around for a bit, I couldn't find a way to make the changes stick, whether they were applied via AppleScript or via directly invoking methods on the MailAccount like -setDisplayName:.

Depending on how desperate you are and how robust your solution must be, you can directly mess with com.apple.mail.plist in ~/Library/Preferences. You'll note the MailAccounts/*/HostName key. I just verified that changes I made there (switched the AccountName, which I'd been trying to make stick via AppleScript as my test) were picked up by Mail.app on the next restart.

—Jeremy

On Wed, Apr 22, 2009 at 6:48 PM, Aaron Wyatt <email@hidden> wrote:
All-

We're in the process of migrating to a new email server.  The script below is supposed to iterate through all mail accounts and change the incoming mail server names to the new server name.  When you run the script on 10.5.6, it seems to work-- check Mail prefs: accounts: incoming server-- until you quit Mail, reopen Mail, and see the settings are gone.  I can't find anything anywhere that indicates how to trigger an account settings change save action via AppleScript. This makes me think its a bug?

As you can see below, this should be so simple, and its killing me that it won't save the settings (no other accounts properties I change will save either).

Any help will be greatly appreciated.

Thanks,
aaron

--start script
tell application "Mail"
       repeat with eachAccount in accounts
               set server name of eachAccount to "test.domain.edu"
       end repeat
end tell
--end script
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Apple Mail 3.5: Changing Mail Server Settings (From: Aaron Wyatt <email@hidden>)

  • Prev by Date: Re: Quit application script when closes the window
  • Next by Date: Re: Apple Mail 3.5: Changing Mail Server Settings
  • Previous by thread: Apple Mail 3.5: Changing Mail Server Settings
  • Next by thread: Re: Apple Mail 3.5: Changing Mail Server Settings
  • Index(es):
    • Date
    • Thread