Skip to main content
Solved

Basic Scripting question

  • September 12, 2012
  • 5 replies
  • 0 views

Forum|alt.badge.img+11
  • Contributor
  • 33 replies

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

Best answer by jarednichols

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

View original
Did this topic help you find an answer to your question?

5 replies

Forum|alt.badge.img+24
  • Valued Contributor
  • 1892 replies
  • Answer
  • September 12, 2012
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


Forum|alt.badge.img+13
  • Contributor
  • 427 replies
  • September 12, 2012

using gui scripting is fragile. avoid.


Forum|alt.badge.img+16
  • Legendary Contributor
  • 7880 replies
  • September 12, 2012

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.


Forum|alt.badge.img+11
  • Author
  • Contributor
  • 33 replies
  • September 13, 2012

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


Forum|alt.badge.img+24
  • Valued Contributor
  • 1892 replies
  • September 13, 2012

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings