Re: write file to /Library/Preferences
Re: write file to /Library/Preferences
- Subject: Re: write file to /Library/Preferences
- From: Luther Fuller <email@hidden>
- Date: Thu, 21 Feb 2008 17:20:36 -0600
On Feb 21, 2008, at 3:47 PM, Philip Aker wrote:
On 2008-02-21, at 12:48:21, Rainer Standke wrote:
is it possible from AppleScript to write a file to /Library/
Preferences if the current user is not an administrator? How?
If you have an administrator password, almost anything is possible.
Otherwise, no.
I have a managed (non-admin) account named "dummy" for testing these
things.
So I ran this in "dummy" to see what happened ...
do shell script "defaults write com.authorName.applName x y"
No password was required. A new preference file named
"com.authorName.applName.plist" appeared in the /dummy/Library/
Preferences/ folder.
Note1: This .plist preference file contains just the key "x" which is
always a string having the value "y". (As indicated by my
experiments. The 'defaults' man page says there should be some quotes
in there.) You'll have to create a preference file where "x" and "y"
are replaced by something meaningful to your project.
Note2: Read and write a plist preference file using System Events. It
knows how to translate xml to/from AppleScript records. No special
formatting required.
_______________________________________________
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