• 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: Sending Commands to Terminal Windows
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sending Commands to Terminal Windows


  • Subject: Re: Sending Commands to Terminal Windows
  • From: Jeffrey Berman <email@hidden>
  • Date: Sat, 24 Aug 2002 22:43:18 -0500

On 8/24/02 10:22 PM, Christopher Nebel <email@hidden> wrote:

> On Thursday, August 22, 2002, at 04:51 PM, Jeffrey Berman wrote:
>
>> Does the absence of a response to these questions mean that neither action
>> can be accomplished with AppleScript?
>
> No, it means you've got to be patient. Now that 10.2 has officially
> shipped, I can give you the complete answer to your question:

Chris:

Thank you for responding.


> Neither (1) nor (2) is possible in 10.1.x -- "do script" always spawns
> a new window, and because of how terminal input works, you can't issue
> a command and respond to a prompt it puts up in a single command.

Ah, now I have an explanation for why my syntax was failing.


> Terminal in 10.2 redefines the "do script" command a bit. First --
> this is incidental to your question, but I wanted to mention it -- it
> now lets you give the command as the direct parameter, so you can just
> say 'do script "ls"' without that stupid "with command" parameter.
> ("with command" still works, but it's deprecated now. It was only
> necessary because of a now-lifted restriction in Cocoa Scripting.)
>
> Second -- and this *is* relevant -- there's now an "in" parameter which
> takes a window. If you leave it off, you'll get the old
> spawn-a-new-window behavior, but if you say "in window <whatever>",
> it'll use that window. The other cool bit is that it really just
> treats the "command" as input, so while you still can't issue a command
> and respond to a prompt in one shot, you can do it in two:
>
> do script "slogin somewhere.com"
> do script "password" -- types the password.

Would there need to be an "in" parameter for the second line to avoid
spawning a new window?

You know, AppleScript might really take off some day once there is decent
documentation explaining the details as well as you've been doing on this
list.

-Jeffrey Berman
_______________________________________________
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: Sending Commands to Terminal Windows
      • From: John Delacour <email@hidden>
    • Re: Sending Commands to Terminal Windows
      • From: Christopher Nebel <email@hidden>
References: 
 >Re: Sending Commands to Terminal Windows (From: Christopher Nebel <email@hidden>)

  • Prev by Date: Re: Sending Commands to Terminal Windows
  • Next by Date: Re: Sending Commands to Terminal Windows
  • Previous by thread: Re: Sending Commands to Terminal Windows
  • Next by thread: Re: Sending Commands to Terminal Windows
  • Index(es):
    • Date
    • Thread