| View previous topic :: View next topic |
| Author |
Message |
kang Guest
|
Posted: Sun Jul 27, 2008 3:59 am Post subject: sending keystrokes based on the application focused. |
|
|
if I'm using for example plsql developer I want to send "select * from" for the "s" key, while others do nothing.
How can I identify the application currently using and make the script.
Thanks. |
|
| Back to top |
|
 |
Icarus
Joined: 24 Nov 2005 Posts: 507
|
Posted: Sun Jul 27, 2008 6:49 am Post subject: |
|
|
use #IfWinActive <title of your application> before your shortcuts.
You may want to change the title match mode, using SetTitleMatchMode, or for a higher accuracy, you may want to use the Windows Spy to determine your windows class, and use it instead.
The following two codes do the work for Firefox for example:
| Code: |
SetTitleMatchMode RegEx
#IfWinActive .*Firefox.*
F12::SoundPlay *64
|
| Code: |
#IfWinActive ahk_class MozillaUIWindowClass
F12::SoundPlay *64
|
_________________ Sector-Seven (Music and Utilities) |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Sun Jul 27, 2008 4:10 pm Post subject: |
|
|
also note that you only need #ifWinactive once for each group of hotkeys. you don't have to put it before every hotkey. _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
|