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

Plan E from Outer Space


  • Subject: Plan E from Outer Space
  • From: Luther Fuller <email@hidden>
  • Date: Mon, 15 Jun 2009 18:07:01 -0500

Plan A
A few years ago, I was writing a script for Mail that required that the user set Mail's preferences as per the script below. I could have simply written this as installation steps in the instructions, but, who reads the Instructions? So ...

Plan B
I put these lines of code into the script.

tell application "Mail"
activate
set acntList to accounts as list
repeat with anAcnt in acntList
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
end repeat
end tell

I tested this code and I was sure that the preference changes were persistent.
I have now tested this again, a few years later, and found that any changes made to Mail's preferences via AppleScript are temporary. There is a really good reason for these changes to be permanent, so ...

Plan C
I've written code to read and write the preference file, "com.apple.mail.plist", directly. But, if Apple changes the preference file format, my code will break, so, this may not be a good idea. So ...

Plan D
Every application that has preference modifying commands should also have an 'update preferences' command. I'll wait until hell freezes over and use that.

Plan E
(I'm out of plans.)

 _______________________________________________
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

  • Follow-Ups:
    • Re: Plan E from Outer Space
      • From: "John C. Welch" <email@hidden>
    • Re: Plan E from Outer Space
      • From: Bob Studer <email@hidden>
  • Prev by Date: Re: my own scripting additon
  • Next by Date: Re: Plan E from Outer Space
  • Previous by thread: Re: error with scripting bridge/sdp and microsoft word 2008
  • Next by thread: Re: Plan E from Outer Space
  • Index(es):
    • Date
    • Thread