Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to make (1) special key open new terminal window.

I bound it to file /Users/taw/bin/new_term, which contains:

exec osascript -e 'tell application "Terminal" to do script "cd ."'

This does the trick, except it also opens a Terminal window with this (even though is configured to always close windows when processes finish):

Last login: Thu Mar 11 19:41:29 on ttys000
/Users/taw/bin/new_term ; exit;
~$ /Users/taw/bin/new_term ; exit;
tab 1

[Process completed]

How do I make it all work correctly? (possibly using a way different that what I've been attempting so far)

share|improve this question

Because the Microsoft IntelliType Pro software on OS X uses the open command to run whatever you ask it to, it can be difficult to get it to execute arbitrary AppleScript code.

I found that while shell scripts and the like don't work, if you create an Automator (not AppleScript) application with a single Action Run AppleScript you can then point IntelliType to run your Automator Application. Be sure you create an Application, not a Workflow.

I wanted a favorites key to control iTunes, so I used the following inside my Run AppleScript Action, which worked.

on run {input, parameters}

    tell application "iTunes" to next track

    return input
end run
share|improve this answer

Have your special key execute /Applications/Utilities/ instead.

(Out of curiosity, how are you binding a key to a command?)


I try to keep anything Microsoft away from Mac OS, because they don't really seem to grok the Mac way. The fact that it's using open for everything is proof of this.

So, if I were you, I'd rip out the Microsoft keyboard driver, and use Spark instead:

If you really want to use AppleScript to do what you're doing, perhaps this will be of use:

You could also snag some of the AppleScript from the latter link and trigger it with a hotkey using Spark.

share|improve this answer
Microsoft Keyboard drivers let me bind special keys (or any keys) to arbitrary file or URL. I think it tries to open the file using generic open command. Starting /Applications/Utilities/ seems to start a new process - not what I want. And then it opens the same window [Process completed] window. – taw Mar 11 '10 at 20:31
Spark doesn't see special keys on Microsoft Keyboard at all. – taw Mar 11 '10 at 22:58
So then don't use the special keys. Use command-control-0 or whatever you want. – Alexander Burke Mar 12 '10 at 7:51

Use one of the options to start a program or execute a script without opening Terminal I describe in this answer.

To open a new terminal window, or just Terminal with a default window, you can try to adapt this solution.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .