• 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 16:24:55 -0700

On Nov 1, 2007, at 11:08 PM, Michelle Steiner wrote:

It doesn't return any errors, but it doesn't do anything either. I suspect that it is a permissions issue, but I have no idea of how to address it.

tell application "System Events"
tell property list file "Dora:System:Library:LaunchDaemons:com.apple.backupd-auto.plist"
set value of property list item 4 of it to 7200
end tell
end tell

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.


Beware that "property list item 4" is not reliable. Property list items in a dictionary (such as this one is) are not in any deterministic order, and may move if the file is changed. Referring to them by name (e.g., 'property list item "StartInterval"') is a much better way to go.


--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: Laine Lee <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>)

  • Prev by Date: Re: prevent user input question
  • Next by Date: Re: [Slightly OT] Scripting Bridge in Leopard
  • Previous by thread: Re: Why doesn't this script work?
  • Next by thread: Re: Why doesn't this script work?
  • Index(es):
    • Date
    • Thread