| Article: |
Automated Backups on Tiger Using rsync | |
| Subject: | Rsync part works fine, but what's up with Applescript? | |
| Date: | 2005-08-22 08:28:14 | |
| From: | bbushman | |
|
I'm happily able to run these scripts in the terminal window, but am trying to use them via applescript as mentioned in this article. Same error I've seen noted earlier here - the script will compile, but when I run it I get back this error "can't make current application into type string".
|
||
Showing messages 1 through 6 of 6.
-
Rsync part works fine, but what's up with Applescript?
2005-09-23 09:58:15 annibee [View]
The same thing happened to me and so I took the carriage return away from the end of do shell script and then it worked. :)
-
Rsync part works fine, but what's up with Applescript?
2005-08-22 10:51:38 bbushman [View]
Scratch that - I put it in the middle of a function and now the applescript portion works fine... and rsync appears to be running, because it's making my error file in my user folder. But: nothing actually sync's. What could be wrong with my shell script? -
Rsync part works fine, but what's up with Applescript?
2005-08-22 11:26:17 bbushman [View]
Eh. Function didn't really fix anything. All my questions still remain. :( -
Rsync part works fine, but what's up with Applescript?
2005-08-23 10:09:13 Corvus [View]
mySrc & myTgtwill catenate the two paths into a single huge path, which almost certainly doesn't exist, and will have no target path. You need to separate the paths with a space:
mySrc & " " & myTgt
-
Rsync part works fine, but what's up with Applescript?
2005-08-22 08:40:09 bbushman [View]
PS: just read the betalogue post related to this topic (thanks pierre!) Perhaps adding /usr/local/bin/ to the beginning will help after I stop getting my other error, but for now, I'm still (of course) getting the AS error.
Of note (which I'm assuming is obvious to anyone who knows what they are doing) is that in my event log in script editor, I"m left with this after I try running the script:
tell current application
do shell script current application
"Can't make current application into type string."
Anyone? -
Rsync part works fine, but what's up with Applescript?
2005-09-10 08:27:00 rharder [View]
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"
quit
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,
Ray


