• 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: Why doesn't this script work?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why doesn't this script work?


  • Subject: Re: Why doesn't this script work?
  • From: Christopher Nebel <email@hidden>
  • Date: Fri, 2 Nov 2007 17:55:52 -0700

On Nov 2, 2007, at 5:13 PM, Michelle Steiner wrote:

On Nov 2, 2007, at 4:24 PM, Christopher Nebel wrote:

Permissions is a good guess, since at least on my system, that file is only writable by root. Since System Events doesn't have a way to authenticate file operations, the best I can suggest is to change the permissions on the file -- 'do shell script "chmod a+w / System/Library/LaunchDaemons/com.apple.backupd-auto.plist" with administrator privileges' should do the trick.

That worked. How do I change it back, programatically, after writing to it?

If you're willing to assume that it's supposed to be root-writable only, then use the same chmod(1) command, but change "a+w" to "go-w". If you want to get the old permissions and then set them back (in other words, make it general purpose for any file), then it's harder. I'd suggest using Finder to do it, seeing as how it reads a lot better, but unfortunately it doesn't work -- Finder just doesn't try to authenticate the "set" operation and simply ignores it.



--Chris Nebel AppleScript Engineering

_______________________________________________
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: Why doesn't this script work?
      • From: Michelle Steiner <email@hidden>
    • Re: Why doesn't this script work?
      • From: Michelle Steiner <email@hidden>
References: 
 >Why doesn't this script work? (From: Michelle Steiner <email@hidden>)
 >Re: Why doesn't this script work? (From: Christopher Nebel <email@hidden>)
 >Re: Why doesn't this script work? (From: Michelle Steiner <email@hidden>)

  • Prev by Date: AppleScript URL Protocol
  • Next by Date: Re: Why doesn't this script work?
  • Previous by thread: Re: Why doesn't this script work?
  • Next by thread: Re: Why doesn't this script work?
  • Index(es):
    • Date
    • Thread