Hey -
I'm trying to create an Applescript for OS X that'll allow a user to drop a file onto it, then the script will log onto my FTP server, give username and password, and upload the file, then log out. Basically, it's to save some clients from having to use an FTP client.
I know I can give commands in this format
ftp user@servername.com:command:command:quit
What I want to know is how to include the password with that? I can make the line work properly, except that it prompts me for a password each time. I'd rather not do that, if at all possible.
IIRC the URL standard for including a pw is something like:
ftp user:passwd@site.com
Yep, it's right there on the man page for ftp. I dunno if it works like that through AppleScript, but it would work quite well in a bash/tcsh/etc script.
Hmmm...tried that and it refused, even from terminal. Perhaps it's something odd with my FTP server itself. Let me try it out on another few I have passwords for, and see if it works.
You might try enclosing some of the funky parts with quotes to protect it from the shell trying decode it into commands:
ftp "user:passwd@site.com"
I know I have to use that trick when I want curl to work right on a multiple file grab:
curl "http://www.site.com/files/image[001-150].jpg" -O
and some other fun things.