• 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: Move and resize the window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Move and resize the window


  • Subject: Re: Move and resize the window
  • From: Graff <email@hidden>
  • Date: Fri, 05 Mar 2004 02:03:29 -0500

To find the dictionary for any program just run Script Editor and go to File->Open Dictionary. If it is not listed there then go to the button at the bottom of that window that says Browse and click on it. Then navigate to the program and if it is not dimmed select it and hit the Choose button. Later versions of Script Editor also have a Library window that you can put applications in for easy access. You hit shift-apple-L to toggle the window open or closed.

To open a new Terminal window all you have to do is run a command. You do it like this:
----------
tell application "Terminal"
do script ""
end tell
---------

The blank command will just cause a window to open. To run a command instead of just doing nothing you would do something like this:
---------
tell application "Terminal"
do script "cd ~/Documents/"
end tell
---------

This will execute the command "cd ~/Documents/" in a new Terminal window.

To do more shell commands in the same window without combining them into one "do script" command you could combine them with a semicolon like this:
---------
tell application "Terminal"
do script "cd ~/Documents/; ls -l"
end tell
---------

This is exactly how you would combine commands if you wanted to do this in the shell.

If you can't combine them then you will have to save what window you are working in so that you can do each command in that window. Since the last window opened is the front one this is easy:
---------
tell application "Terminal"
do script "cd ~/Documents/"
set theWindow to front window
delay 1
do script "ls -l" in theWindow
end tell
---------

You need to have a little delay in there because for some reason if the commands are entered too quickly they don't get executed properly. I did a delay of 1 second to prevent this

-Ken


On Mar 4, 2004, at 10:35 PM, Juguang Xiao wrote:

I am very new to AppleScript, so my this question may be quite naive. I cannot find a right reference to answer it.

How to open a new Terminal, rather than activate it? And how to move and resize the window of it?

One general question is how to find the method set of one specific Application? Such as what are methods available for/in/from Terminal.
_______________________________________________
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: Move and resize the window
      • From: steve harley <email@hidden>
    • Re: Move and resize the window
      • From: Juguang Xiao <email@hidden>
References: 
 >Move and resize the window (From: Juguang Xiao <email@hidden>)

  • Prev by Date: Re: TechNote 2106
  • Next by Date: Re: modifying default behavior of buttons in Mail.app
  • Previous by thread: Move and resize the window
  • Next by thread: Re: Move and resize the window
  • Index(es):
    • Date
    • Thread