Hello,
I have a droplet AppleScript that I use to back up a document. It makes three backups. It backs up to folders on my external drive, iDisk, and FTP server named according to the days of the week, and then within them, numbered folders, 1, 2, 3 etc.
For example, the first time I drop a file on the droplet on, say, Wednesday, it will back up to a folder named “1” in the Wednesday folder on each of the backups. The next time I drop the file on the droplet on Wednesday, it will back up to a folder named “2” in the Wednesday folder on each backup. (The folders were all created beforehand.)
I use Transmit to put the file on the FTP server.
The script worked perfectly for many months. But last October or November- (it could have been when the second update to Snow Leopard occurred 10.6.2), part of the Transmit part of my script suddenly stopped working - it stopped uploading the file and would give me the error line from my Script- “Sorry, Transmit was unable to move the file.” (The backup to the external hard disk and my MobileMe continue to work.)
I hadn’t made any changes to the script (that I know of) and part of the Transmit code still works- it connects to the FTP server and sets ‘their stuff’ to the proper folder. It just won’t upload the file.
If anyone can help me in getting the file to upload it would be appreciated. I’m not that familiar with scripting Transmit, I got my code for it originally from the web somewhere, perhaps Panic’s site. Perhaps there’s a more efficient way to upload that would work.
Thanks.
property targetFolder : 1
property day_script_last_run : "AnyDay" -- need to set this according to what day it is.
on open (docName)
tell application "Finder"
copy docName as string to docName1
-- docName1 is used with the do shell scripts in coping to my external hard drive and iDisk
set currentDay to weekday of (current date) as string
if currentDay is not equal to day_script_last_run then
set day_script_last_run to currentDay
set targetFolder to 1
end if
---- code for backing up to my external hard drive and iDisk removed
end tell
activate application "Transmit"
tell application "Transmit"
make new document at before front document
tell document 1
tell session 1
connect to "myserver with my password" -- I've removed the name of my server and its password
set their stuff to "/public_html/my directory /" & currentDay & "/" & targetFolder
try
repeat with the_item in docName
upload item the_item
end repeat
on error
display dialog "Sorry, Transmit was unable to move the file."
end try
end tell
end tell
end tell
set targetFolder to targetFolder + 1
end open