So I have a shell script called > tm.sh which gets the last time time machine successfully backed.
This works fine in the
I'm unsure why the "do shell script" line is not working
tm.sh
My calendar alarm
Automator > New > Calendar alarm > run apple script
Calendar Alarm AppleScript
I have given full disk access to
The action: "Run AppleScript" encountered an error: Can't get text 1 thru 4 of ""."
This works fine in the
shell,
script editor,
automator
I'm unsure why the "do shell script" line is not working
tm.sh
Code Block #!/bin/sh enabled=`/usr/bin/defaults read /Library/Preferences/com.apple.TimeMachine AutoBackup` if [ "$enabled" == "1" ];then lastBackupTimestamp=`date -j -f "%a %b %d %T %Z %Y" "$(/usr/libexec/PlistBuddy -c "Print Destinations:0:SnapshotDates" /Library/Preferences/com.apple.TimeMachine.plist | tail -n 2 | head -n 1 | awk '{$1=$1};1')" "+%Y-%m-%d %H:%M:%S"` echo "$lastBackupTimestamp" else echo "<result>Disabled</result>" fi
My calendar alarm
Automator > New > Calendar alarm > run apple script
Calendar Alarm AppleScript
Code Block on callDateSeperator(dateChange) set yN to text 1 thru 4 of (dateChange as text) set mN to text 6 thru 7 of (dateChange as text) set dN to text 9 thru 10 of (dateChange as text) return {yN, mN, dN} end callDateSeperator on run {input, parameters} set timeMachineLastDate to (do shell script "sh ~/Desktop/tm.sh") set tmDate to callDateSeperator(timeMachineLastDate) display dialog (item 1 of tmDate) & (item 2 of tmDate) & (item 3 of tmDate) return input end run
I have given full disk access to
automator
calendar
The action: "Run AppleScript" encountered an error: Can't get text 1 thru 4 of ""."