View Full Version : Converting an Apple script to a shell script ...

06-27-2010, 12:56 PM
Hi Dave,

I have a regular Apple script that I would like to execute before actually beginning the backup. This is the script:

property imagesPathList : {"/Sauvegardes/SuperDuper/Duplication - iMacG5.sparseimage"}

tell application "Caffeine"
turn on
end tell

repeat with i in imagesPathList
set filePath to i
do shell script "hdiutil compact " & quoted form of filePath
end try
end repeat

tell application "Caffeine"
turn off
end tell

Can you help me translate this to a shell script ?



06-27-2010, 05:17 PM
Wouldn't it make more sense to store this in an applescript file, and run that from a shell script? In other words:

osascript -e /path/to/some/script

06-27-2010, 07:35 PM
Hi Dave,

The only way I used shell scripts is from inside an AppleScript. Now I will be doing it the other way around, and I know nothing about shell scripting.

I will try it and get back ...

Thank you.