Shirt Pocket Discussions

Shirt Pocket Discussions (https://www.shirt-pocket.com/forums/index.php)
-   General (https://www.shirt-pocket.com/forums/forumdisplay.php?f=6)
-   -   Converting an Apple script to a shell script ... (https://www.shirt-pocket.com/forums/showthread.php?t=6228)

rlesperance 06-27-2010 11:56 AM

Converting an Apple script to a shell script ...
 
Hi Dave,

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

Code:

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:

Code:

!/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


All times are GMT -4. The time now is 02:37 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.