Re: Scripting Terminal.app
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.