How to make Microsoft Keyboard special keys run osascript commands on OS X?
        Posted  
        
            by t-a-w
        on Super User
        
        See other posts from Super User
        
            or by t-a-w
        
        
        
        Published on 2010-03-11T19:45:23Z
        Indexed on 
            2010/03/12
            21:17 UTC
        
        
        Read the original article
        Hit count: 299
        
I'm trying to make (1) special key open new terminal window.
I bound it to file /Users/taw/bin/new_term, which contains:
#!/bin/sh
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 Terminal.app 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
logout
[Process completed]
How do I make it all work correctly? (possibly using a way different that what I've been attempting so far)
© Super User or respective owner