advertisement

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".


I've read this tech note at apple to help investigate the problem:
http://developer.apple.com/technotes/tn2002/tn2065.html#TNTAG3


Coping stategies have included:
1. keep the do shell script out of any tell blocks
2. putting it within a "tell me" block
3. running it all as one quoted command
4. storing my file paths as string vars in POSIX form (ie. "/Volumes/MyHD/Library/WebServer/etc.) and then concatenating them into the shell script
5. storing my file paths as string vars in applescript form (ie. "MyDisk:Library:WebServer:etc.) and then concatenating them into the shell script using "quoted form of the POSIX path"
6. adding /bin/bash -c to make sure they run in the same shell as my terminal instead of in sh
7. Kicking and screaming like a little girl while shouting obscenities


Also note: I've installed for now the RSyncX version, as recommended in this forum by "mechanist" on this forum. Again, works peachy in terminal, no dice in Applescript.


What am I doing wrong here, folks?


Current version of the script look like this:

-- initial vars
set buildCart to "TheLoraxG4PB-HD:Users:bbushman:DEV:brandsourcedev:website:trunk:src:cart"
set siteCart to "TheLoraxG4PB-HD:Library:WebServer:Documents:brandsourcedev"


set mySrc to quoted form of the POSIX path of buildCart
set myTgt to quoted form of the POSIX path of siteCart


-- sync 1
do shell script
"/bin/bash rsync -a --eahfs " & mySrc & myTgt & " || echo -n"




1 to 3 of 3
  1. Rsync part works fine, but what's up with Applescript?
    2005-09-23 09:58:15  annibee [View]

  2. Rsync part works fine, but what's up with Applescript?
    2005-08-22 10:51:38  bbushman [View]

    • Rsync part works fine, but what's up with Applescript?
      2005-08-22 11:26:17  bbushman [View]

      • Rsync part works fine, but what's up with Applescript?
        2005-08-23 10:09:13  Corvus [View]

  3. Rsync part works fine, but what's up with Applescript?
    2005-08-22 08:40:09  bbushman [View]

    • Rsync part works fine, but what's up with Applescript?
      2005-09-10 08:27:00  rharder [View]

1 to 3 of 3