• 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: hi everyone.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hi everyone.


  • Subject: Re: hi everyone.
  • From: Deivy Petrescu <email@hidden>
  • Date: Fri, 3 Oct 2003 20:38:38 -0400

On Friday, Oct 3, 2003, at 16:19 US/Eastern, Walter Ian Kaye wrote:

At 03:20p -0400 10/03/2003, mathew didst inscribe upon an electronic papyrus:

i'm attempting to learn applescript these days and have found out that
the terminal is scriptable. because of this, i'm trying to write a script that
allows me me access a web directory (my own) via the terminal's ftp command.

i'd like the script to put in the username and password itself and just
connect automatically.

can applescript do this?

my code (so far..)
tell application "System Events"
if (get name of every process) does not contain "Terminal" then
tell application "Terminal"
activate
end tell
end if

tell application "Terminal"
do script "ftp " & " open http://url.url.com";
end tell
end tell

ideas? thanks in advance.

Well, AppleScript can, but the built-in 'ftp' command is not up to snuff.
You can use 'curl' (comes with os x) or 'ncftp' (use fink to install).
Either of those commands will take URLs with passwords.

HTH,
-Walter


Walter,
I personally disagree. I am not saying that curl is not excellent. It is, however, ftp is really nice in Jaguar.
It has file completion, scrolls over commands, I use it all the time and I am very happy with it. Sometimes, curl is required, then I go the curl's way, but ftp is really nice.

Mathew, if you want to ftp to one or more sites often, you should create a .netrc file in your root directory (i.e. in your home directory) and do something like:

machine your.domain.com login yourUserid password yourPasswword ( macdef init cd public_html )

no breaks in the line.

The first three definitions are mandatory, you will login direct to your site without being prompted for a password or userid.
The part in parenthesis you do the initialization macro "cd public_html" and it is obviously optional.

Now, if you type from terminal:
[localhost:~] ftp your.domain.com

you will be taken straight to your site, if you included the macro, you will be taken to the public_html directory on your site.
And you can use this with curl too. (man curl will let you get the right extension to append, i think it is curl -n, but check).

Hope this helps





Regards

Deivy Petrescu
http://www.dicas.com/
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: hi everyone.
      • From: mathew <email@hidden>
References: 
 >Re: hi everyone. (From: Walter Ian Kaye <email@hidden>)

  • Prev by Date: Re: Setting leading in Quark 5
  • Next by Date: Re: Sockets within Applescript?
  • Previous by thread: Re: hi everyone.
  • Next by thread: Re: hi everyone.
  • Index(es):
    • Date
    • Thread