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