[KM] Add Hot Key Trigger

###MACRO:   [KM] Add Hot Key Trigger

~~~ VER: 1.1    2016-08-20 ~~~

####DOWNLOAD:
[KM] Add Hot Key Trigger.kmmacros (26 KB)


###ReleaseNotes

Macro Author: @JMichaelTX

I just combined the two macros written by @ccstone into one for convenience.

Suggested Trigger: ^⌥T
Macro Group: KM Only


Authored by Christopher Stone 	Author.@ccstone <scriptmeister@thestoneforge.com>
2016/08/19 19:28 : Created
2016/08/19 21:08 : Modified

VER: 1.1    2016-08-20    By:  JMichaelTX
  * ADD Actions to Select Hot Key Trigger

REF:
  * Create hotkey to activate ‘insert trigger’ within km window 
  * https://forum.keyboardmaestro.com/t/create-hotkey-to-activate-insert-trigger-within-km-window/4712/33

---

<img src="/uploads/default/original/2X/7/7b24b761beca3b68fa201695a21977ad52d9f67e.png" width="511" height="465">

### Script
```applescript
--------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2016/08/19 18:30
# dMod: 2016/08/19 21:06
# Appl: Keyboard Maestro Engine, System Events
# Task: 
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Keyboard_Maestro_Engine, @System_Events
# Vers: 1.00
--------------------------------------------------------------------------------

tell application "System Events"
  tell application process "Keyboard Maestro"
    tell (first window whose subrole is "AXStandardWindow")
      tell scroll area 3 of splitter group 1 of group 1
        
        try
          set theButton to first button whose name is "New Trigger" or accessibility description is "New Trigger"
        on error
          try
            set theButton to first button whose name is "Add Trigger" or name is "New Trigger"
          on error
            try
              set theButton to first button whose description is "New Trigger" or accessibility description is "New Trigger"
            on error
              set theButton to first button whose description is "Add Trigger" or name is "New Trigger"
            end try
          end try
        end try
        
        ignoring application responses
          tell theButton
            perform action "AXPress"
          end tell
        end ignoring
        
      end tell
    end tell
  end tell
end tell

delay 0.05

ignoring application responses
  tell application "Keyboard Maestro Engine"
    -- Below Macro now included in main macro (JM) --
    --do script "New Keystroke Trigger → Keystrokes"
  end tell
end ignoring

--------------------------------------------------------------------------------

```
4 Likes