• 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: Scripting Terminal.app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting Terminal.app


  • Subject: Re: Scripting Terminal.app
  • From: John Delacour <email@hidden>
  • Date: Wed, 23 Apr 2003 21:07:14 +0100
  • Mac-eudora-version: 6.0a16

At 1:55 pm +0100 22/4/03, Andy Park wrote:

Can anyone give me a quick example of scripting the terminal to open a new window exactly as I would do by pressing cmd-n ?

tell application "Terminal" to do script "What now, then?"


In general, is there any way of relating Applescript with keystrokes that users normally perform with specific applications? Ultimately, I'd like to create a script that asks the for an application, then create the default window for the application. Generally the shortcut should be cmd-n (excluding the Finder which seems to always have a logic of its own :)), so

try
set dd to display dialog "
Type the name of an application
" default answer "TextEdit" with icon 1
on error
return
end try
set _app to dd's text returned
tell application _app
activate
try
make document
on error
try
make document at end
on error
try
make window
end try
end try
end try
end tell



I thought I'd start off with sending an application the shortcut. I'm thinking maybe this is a bad approach

You're right.

but I'm still curious on implementing a shortcut emulation in Applescript.

Get iKey.
_______________________________________________
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.

References: 
 >Scripting Terminal.app (From: Andy Park <email@hidden>)

  • Prev by Date: Re: Scripting-system error
  • Next by Date: Re: Inheritance dilemma
  • Previous by thread: Scripting Terminal.app
  • Next by thread: Re: Scripting Terminal.app
  • Index(es):
    • Date
    • Thread