• 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: Michelle Steiner <email@hidden>
  • Date: Fri, 2 Nov 2007 21:27:24 -0700

Here is the penultimate version of the script; I need to put in some error checking to ensure that only a number is entered into the dialog.

-- Michelle

set the DialogReturn to (display dialog "Enter the backup interval you wish." default answer "1" buttons {"Hours", "Minutes", "Cancel"} default button "Hours" with title "Set Time Machine Backup Interval")
set the RawNumber to the text returned of the DialogReturn as number
set the TimeUnit to the button returned of the DialogReturn
if the TimeUnit is "Minutes" then
set the BackupInterval to the RawNumber * minutes
else if the TimeUnit is "Hours" then
set the BackupInterval to the RawNumber * hours
end if
set the BackupInterval to the BackupInterval as integer

set thePath to ((path to library folder from system domain) as text) & "LaunchDaemons:com.apple.backupd-auto.plist"
do shell script ¬ "chmod a+w /System/Library/LaunchDaemons/com.apple.backupd-auto.plist" with administrator privileges
tell application "System Events"
tell property list file thePath
set value of property list item "StartInterval" of it to the BackupInterval
end tell
end tell
do shell script "chmod go-w /System/Library/LaunchDaemons/com.apple.backupd-auto.plist" with administrator privileges

--
"We have succeeded for 205 years in keeping the affairs of state 
separate from the uncompromising idealism of religious groups and we 
mustn't stop now. To retreat from that separation would violate the 
principles of conservatism and the values upon which the framers built 
this democratic republic." --Barry Goldwater,

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

  • Prev by Date: Re: Why doesn't this script work?
  • Next by Date: Re: Tabs in Terminal.app on 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