• 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: Plan E from Outer Space
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Plan E from Outer Space


  • Subject: Re: Plan E from Outer Space
  • From: Luther Fuller <email@hidden>
  • Date: Tue, 16 Jun 2009 12:55:45 -0500

I'm going with Plan C, at least for the present. I couldn't get my script to work at first. After trying for an hour or so, I discovered that AppleScript commands such as these in Mail are always temporary:

set (move deleted messages to trash of anAcnt) to true
set (empty trash frequency of anAcnt) to -1 -- = never
set (empty sent messages frequency of anAcnt) to -1 -- = never

These commands do not modify mail's prefs file and when you quit Mail, the old values are always written to the prefs file. I had to use a script like this ...

tell application "Mail" to quit
--  get path to the "com.apple.mail.plist" preference file
-- read the "com.apple.mail.plist" preference file
tell application "System Events"
set mailAccountsList to (value of property list item "MailAccounts" of property list file prefsPath)
end tell
-- modify mailAccountsList
-- write the "com.apple.mail.plist" preference file
tell application "System Events"
set value of property list item "MailAccounts" of property list file prefsPath to mailAccountsList
end tell
tell application "Mail" to activate

If you need to permanently modify any application's preferences, you, too, may encounter this situation.

 _______________________________________________
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: 
 >Plan E from Outer Space (From: Luther Fuller <email@hidden>)
 >Re: Plan E from Outer Space (From: Bob Studer <email@hidden>)

  • Prev by Date: Re: error with scripting bridge/sdp and microsoft word 2008
  • Next by Date: Re: error with scripting bridge/sdp and microsoft word 2008
  • Previous by thread: Re: Plan E from Outer Space
  • Next by thread: Re: Plan E from Outer Space
  • Index(es):
    • Date
    • Thread