Skip to main content

I'm tinkering and trying to make life easier with scripts. One that would help is the ability to use SHIFT+COMMAND and a keystroke. For my COMMAND only scripts, I'm using something like this:

osascript -e 'tell application "System Events" to key code {13} using command down'

How can I incorporate the SHIFT key into this script?

Thanks--DVG

osascript -e 'tell application "System Events" to key code {13} using command down, shift down'

This may help you out: http://dougscripts.com/itunes/itinfo/keycodes.php


using gui scripting is fragile. avoid.


Yeah, I'd be interested in seeing the larger scale of what you're trying to do with this script. 90% of the time things can be done with bash or perl, etc. Using AS to press keys or click buttons and menus is crude and prone to break.


Jared, I had to add curly braces to your code, but it worked. I appreciate it!

I'd love to get more in-depth with Perl/Bash, I just need to sit down with someone for a bit and test a few things out to get it straight in my head, then I can put it to good use.

Thanks for the replies! DVG


If you've got questions on shell scripts (help with syntax and ideas etc) feel free to hit me off-list.