Jump to content


Photo

How to send ` if window not active - Solved


  • Please log in to reply
4 replies to this topic

#1 MrShortcut

MrShortcut
  • Members
  • 124 posts

Posted 19 August 2012 - 09:41 PM

When I have a work order window open I'd like to be able to press the ` key to send the ctrl+Shift+S shortcut to save and close the workorder. This I have been able to complete with the code below, but I am having issues telling the script that if any other window is active to ignore the scritp and instead send the ` key.

IfWinactive, Work Order
Send, {CTRLDOWN}{SHIFTDOWN}s{SHIFTUP}{CTRLUP}
else
Send, {`}
return

Can someone assist in correcting the script?

#2 vsub

vsub
  • Members
  • 612 posts

Posted 19 August 2012 - 10:07 PM

Where is your hotkey,try it like this

$SC029::
IfWinactive, Work Order
Send, {CTRLDOWN}{SHIFTDOWN}s{SHIFTUP}{CTRLUP}
else
Send, {SC029}
return

#3 vahju

vahju
  • Members
  • 329 posts

Posted 20 August 2012 - 03:48 AM

Try #IfWinActive

#IfWinActive, Work Order ahk_class <EnterClassHere>
$SC029::
Send, {CTRLDOWN}{SHIFTDOWN}s{SHIFTUP}{CTRLUP}
#IfWinActive
Return

#4 MrShortcut

MrShortcut
  • Members
  • 124 posts

Posted 20 August 2012 - 02:33 PM

Thanks. The following works for what I need. I knew the ` was a special character but I never heard of the "SC029" option before.
$SC029::
IfWinactive, Work Order
Send, {CTRLDOWN}{SHIFTDOWN}s{SHIFTUP}{CTRLUP}
else
Send, {SC029}
return


#5 vsub

vsub
  • Members
  • 612 posts

Posted 20 August 2012 - 07:15 PM

This is actually the same button but his scan code