Re: A more elegant file delete via AppleScript and FTP?
Re: A more elegant file delete via AppleScript and FTP?
- Subject: Re: A more elegant file delete via AppleScript and FTP?
- From: Takaaki Naganoya <email@hidden>
- Date: Tue, 19 Sep 2006 19:20:35 +0900
- Thread-topic: A more elegant file delete via AppleScript and FTP?
How about this code? Typical and not original one....
<applescript>
set ftpUser to "<username>"
set ftpPass to "<password>"
set fileName to "<filename>"
set ftpServer to "ftpserver_domain/directory/"
set ftpRes to deleteFileOnFTP(ftpUser, ftpPass, ftpServer, fileName) of me
log ftpRes --> contens of specified directory or error message
on deleteFileOnFTP(ftpUser, ftpPass, ftpServer, fileName)
set fText to quoted form of ("ftp://" & ftpUser & ":" & ftpPass & "@" &
ftpServer)
set aText to "echo 'delete " & fileName & "' | ftp " & fText
set resText to do shell script aText
return resText
end deleteFileOnFTP
</applescript>
--
Takaaki Naganoya
Piyomaru Software
http://piyo.piyocast.com
On 06.9.19 4:54 PM, "Jeremy" <email@hidden> wrote:
> In attempting to remove temporary files created on my webserver by a
> script, I have been struggling with the inelegance of my solution. I
> have a username with an @ in it so I'm not sure if I can create one of
> the more elegant shell scripts to remove the files and I do not have
> direct terminal access to the server (nor would I want the script to
> have it as it will be distributed to my family members).
>
> tell application "Terminal"
> activate window
> do script "ncftp -u email@hidden -p password ftp.mydomain.com" in
> window 1
> delay 10
> tell application "System Events"
> tell process "Terminal"
> set frontmost to true
> keystroke "cd temporarydirectory" & return & "rm *.*" & return &
> "quit" & return & "n" & return
> end tell
> end tell
> delay 10
> quit
> end tell
>
> Is there a more straightforward solution than what I have above?
>
> Thanks,
>
> Jeremy
>
> _______________________________________________
> 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
>
_______________________________________________
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