• 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: write file to /Library/Preferences
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: write file to /Library/Preferences
      • From: David LeBer <email@hidden>
References: 
 >write file to /Library/Preferences (From: Rainer Standke <email@hidden>)
 >Re: write file to /Library/Preferences (From: Philip Aker <email@hidden>)

  • Prev by Date: Re: Broken date math on AppleScript 2.0
  • Next by Date: Re: write file to /Library/Preferences
  • Previous by thread: Re: write file to /Library/Preferences
  • Next by thread: Re: write file to /Library/Preferences
  • Index(es):
    • Date
    • Thread