PDA

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


rlesperance
06-27-2010, 11:56 AM
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
try
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 ?

Regards.




Robert

dnanian
06-27-2010, 04: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:


!/bin/sh
osascript -e /path/to/some/script

rlesperance
06-27-2010, 06: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.


Robert