Subject:   Rsync part works fine, but what's up with Applescript?
Date:   2005-09-10 08:27:00
From:   rharder
Response to: Rsync part works fine, but what's up with Applescript?

I had the same problem and you actually solved it for me with your last comment. I think that the problem is that the regular Apple scripters made some assumptions that would be common sense to them and left that part out. Being an ignoramous of grand proportions, I had to think through this whole problem and start from scratch. I looked at your last comment and saw "current application" and realized that the AppleScript was making the assumption that this script was to be passed to the current active app and not the terminal.

So I looked at the dictionary from terminal and the help from AppleScript and came up with the following:

You have to explicitly tell terminal to execute the shell script.

e.g. (The quoted text below should be on one line.)

tell application "Terminal"
do shell script "ls /Users/rharder/Desktop/Test/ > /Users/rharder/Desktop/test.txt"
end tell

It also works with "do script" for "do shell script"....

You can leave off the "quit" at the end, but the terminal app remains after execution.

This solution seems to allow any number of shell scripts to be executed from iCal rather than cron which is nifty and cool and all that jazz.....

You should be able to figure out how to marry bash, AppleScript, and iCal with this info.....

Hope this helps, good luck,