Add Ability to Insert 'Favorite Actions' by Name Search Bar

The thing that makes these new Favorite Actions super-powerful is that they sync between machines (if syncing is turned on) with no new setting needed by the User. Yes, Peter has thought it through very well and kept it nice and simple.

1 Like

So, for what it's worth, the below Macro works to do this:

First press of the hotkey (in my case Alt+A) would bring up this (as it does already). And I have typed "prompt" as what I am searching for. So, I get a search for any of my Favorite Actions that contain the word "prompt":

image

While this search field is still open and still contains "FAV prompt" a second press of the same hotkey (in my case Alt+A) removes "FAV" from the head of the search to open up the search to all inbuilt Actions containing the word "prompt":

image

1 Like

Hey Dan,

Yep.

-Chris

--------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2021/11/06 04:24
# dMod: 2021/11/06 04:24 
# Appl: Keyboard Maestro Editor, System Events
# Task: Select Menu Item ā€œInsert Action by Nameā€¦ā€ and Insert ā€œFAV ā€ into the Search Field.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Keyboard_Maestro, @System_Events, @Select, @Menu, @Item, @Insert, @Favorites, @Search, @Field
--------------------------------------------------------

tell application "System Events"
   tell application process "Keyboard Maestro"
      
      # Select ā€œInsert Action by Nameā€¦ā€
      tell menu bar 1
         tell menu bar item "Edit"
            tell menu 1
               tell menu item "Insert Action"
                  tell menu 1
                     tell menu item "By Nameā€¦"
                        perform action "AXPress"
                     end tell
                  end tell
               end tell
            end tell
         end tell
      end tell
      
      # Insert ā€œFAV ā€ into ā€œInsert Action by Nameā€¦ā€ field.
      if exists of window "Insert Action By Name" then
         
         tell window "Insert Action By Name"
            tell scroll area 1
               repeat while (exists of text area 1) = false
                  delay 0.1
               end repeat
               tell text area 1
                  set value to "FAV "
               end tell
            end tell
         end tell
         
      end if
      
   end tell
end tell

--------------------------------------------------------
5 Likes

Chris - I just realized I hadn't thanked you for this. I didn't get around to using any of it until yesterday, when I started working on importing my KMFAM actions into KM's native favorites (post to come soon).

2 Likes