RE: Another Shell Script question ftp
RE: Another Shell Script question ftp
- Subject: RE: Another Shell Script question ftp
- From: "Stockly, Ed" <email@hidden>
- Date: Fri, 10 Feb 2006 11:24:49 -0800
Hi again,
You know I think it's taking my longer to learn shell scripting because I'm trying to do it through appleScript's do shell script command.
One of the the problems I've found is that I can do workable version in terminal that doesn't work via do shell script.
So, here's the solution I'm ready to use. Hope there's nothing in there to bite me!
ES
set errLog to {}
tell application "Finder" to set fileName to the name of alias fileToMove
set localFile to quoted form of POSIX path of alias fileToMove
set ftpShellScript to "ftp -d -v -u ftp://" & remoteUserid & ":" & remotePassword & "@" & remoteServer & ":21" & remotePath & fileName & " " & localFile
try
tell application "Terminal"
do script ftpShellScript
delay 3
set shellScriptLog to contents of window 1
end tell
if shellScriptLog contains "226 Transfer complete." then
tell application "Finder"
delete alias fileToMove
empty trash
end tell
else
set the end of errLog to {"File Name: " & fileName, "Shell script:", ftpShellScript, "ErrorMessage: ", errText, " Error code: " & errNum, " User Id: " & remoteUserid, " User password: " & remotePassword, " Remote server: " & remoteServer, " Remote path: " & RemoteDirPath, " Remote directory: " & remoteDirectory, " Error directory: " & errorDirectory, " Shell Script log: " & shellScriptLog} as string
try
tell application "Finder"
move alias fileToMove to erro!
rDirectory
delete fileToMoveAlias
empty trash
end tell
end try
end if
end try
Ed Stockly
Los Angeles Times
Assistant Editor TV Times
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden