Re: Plan E from Outer Space
Re: Plan E from Outer Space
- Subject: Re: Plan E from Outer Space
- From: Luther Fuller <email@hidden>
- Date: Wed, 17 Jun 2009 10:54:43 -0500
On Jun 17, 2009, at 10:25 AM, Matt Neuburg wrote:
On Tue, 16 Jun 2009 12:55:45 -0500, Luther Fuller
<email@hidden>
said:
I'm going with Plan C, at least for the present
You should never touch a preference .plist file directly. User
preferences
are maintained in memory, and the application will write them in and
write
them out when it pleases. If you change the plist file directly, your
changes can be overwritten by the application when it writes out the
preferences. The correct approach is to communicate directly with the
defaults system using the shell "defaults" command. m.
I considered using 'defaults', but after reading its man page, it
seemed that it did exactly what I was doing in System Events (reading
& writing the preference file), but was harder to write the code.
My script checks 3 of Mail's preferences and if properly set,
continues with other business. If these preferences are not properly
set, the snippet I presented yesterday begins by quitting Mail, writes
the preference file, then ends by activating Mail. Writing to the
preference file while Mail is not running prevents overwriting.
Yes, the user can change these preferences, but my script will correct
the change next time it is run and a dialog notifies the user of this
change. Every time.
_______________________________________________
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