I've cobbled together an applescript that doesn't quite do what I want to do, but will hopefully get my point across so someone smarter might be able to clue me in.
What I want is, When Waterfox is running, once an hour, to make a copy of the session restore file.
this script seems to do that, but
1) doesn't seem to stop when Waterfox is closed.
2) there's likely a better way to do this.
Can anyone offer thoughts?
Code:
tell application "System Events" to set isWaterFox to exists (processes where name is "Waterfox")
repeat while isWaterFox
delay 3600
do shell script "cp '/Users/Scav/Library/Application Support/Waterfox/Profiles/ha4g3an5.default/sessionstore-backups/recovery.jsonlz4' '/Users/Scav/Library/Application Support/Waterfox/Profiles/ha4g3an5.default/emergencybackup/'"
tell application "System Events" to set isWaterFox to exists (processes where name is "Waterfox")
end repeat
What I want is, When Waterfox is running, once an hour, to make a copy of the session restore file.
this script seems to do that, but
1) doesn't seem to stop when Waterfox is closed.
2) there's likely a better way to do this.
Can anyone offer thoughts?