• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: A more elegant file delete via AppleScript and FTP?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >A more elegant file delete via AppleScript and FTP? (From: Jeremy <email@hidden>)

  • Prev by Date: A more elegant file delete via AppleScript and FTP?
  • Next by Date: Re: A more elegant file delete via AppleScript and FTP?
  • Previous by thread: A more elegant file delete via AppleScript and FTP?
  • Next by thread: Re: A more elegant file delete via AppleScript and FTP?
  • Index(es):
    • Date
    • Thread