What Are Some Practical Uses of "Export Macro as Finder Trigger File"?

Not having used it myself, and only now reading the Wiki page, the obvious thing is that the trigger value is the trigger file's location. So you could have multiple trigger files, in different folders, for a single macro whose behaviour changes depending on "trigger folder".

Another use that springs to mind is that you could put the trigger files in your Dock or a similar launcher -- even put aliases to your trigger files in a folder and put that in the Dock, for a "popup macro list". I'm sure there are more inventive uses, too.

I have usually have some open folders that're on a NAS. If I lose the connection, the folders disappear.

So I have a Finder Trigger File whose icon is "under" one of the folders. If the folders disappear, I just double-click on the icon to re-login to the NAS and open the folders.

Or I guess I could put the file in the Dock too. For this particular function, I just prefer the file to say a keyboard shortcut or something like that.

3 Likes

sorry: what is NAS ?

I started doing that for some of my macros and am extremely happy with the result, thanks to you. I have a folder of aliases I put in the dock.

thanks very much !

Network Accessed Storage

1 Like

thanks

<nitpick>Network Attached Storage</nitpick>

3 Likes

Thanks for the correction. I knew it didn’t sound quite right, but I had the essence and was, unfortunately, too lazy to look it up.

1 Like

I use a KM trigger file located in my Dock. For many years, I have used a TextEdit file as a scratch pad. I usually erase all the text after a use and close the file. The file was located in my Dock.
KM lets me move the TextEdit window where I want on my 27" display. The trigger file sits in my Dock and looks like a TextEdit file.
This is not anything deep, but something I got used to over the years.

Hi, would you happen to know if there is a way to create a macro to click on a dock icon ? I would use it to display the trigger files in the KM Trigger File folder I created and dragged to the cock.
thanks very much

I think it would have to be AppleScript, and you should be able to an idea of how to do it from @ccstone's excellent post about similar.

Though I'd ask why you want to do this :slight_smile: One of the reasons for putting things in the Dock is to make them easily mouse-able -- if you aren't going to use the mouse then you've other, possibly better, options available. For example, you could use a KM "Prompt for File" action or, with a bit more work, a "Prompt from List".

2 Likes

Thank you.

Yes you are right. I just wanted to add it to my triggers including something for my Stream Deck.

After playing around, I found that click on found image works. The first letter of each file name can serve as trigger.

Thanks very much.

In which case an "Execute AppleScript" action with the following should do it -- change "Downloads" to the name of the folder containing your KM trigger files:

tell application "System Events"
	tell application process "Dock"
		tell list 1
			click UI element "Downloads"
		end tell
	end tell
end tell

Pop that in a macro that can be triggered from StreamDeck and you should be up and running.

2 Likes

Works perfectly, which is obvious, coming from you. Thanks very much !

1 Like

Just in case you also didn't know this one exists, check out "Trigger Macro by Name"! :smiley:

I have a single-step macro that just plays this one action (triggered by ⇧⌘-Space, in my case), and it is literally the most-used macro in my collection because it gives me direct access to all macros. (For similar reasons, make sure to learn the ⌃⌘A shortcut, which presents a similar list, but for Actions!)

Not only does "Trigger Macro by Name" give you quick access to running any Keyboard Maestro macro, if you use ⌥ (alt/option) to select a macro, it'll be opened in Keyboard Maestro, rather than run. This is a lifesaver when a macro misbehaves due to some timing issue or other subtlety missed during initial development.

That latter point bears emphasis because, afaik, it's not explicitly covered in the docs/wiki.

Fwiw, I think Stairways would do well to give this feature its own dedicated shortcut and to support ⌘-Return & ⌘-Click to edit the selection, since that would make it discoverable for anyone who uses the equivalent feature in Spotlight et al, but that suggestion was rejected. Ah well. Still an awesome product, though, is it not? :nerd_face:

I use it to edit macro (opt click on list of macros), but the delay before the macros list is displayed is is too long to be of practical use IMO, except for rarely used macros. Thank you for your comment.

It doesn’t stop there!

Here’s the set of really useful shortcuts when editing macros in the KM editor:

A - insert an Action (in a macro)
T - insert a Token (in a field)
V - insert a Variable (in a field)
F - insert a Function (in a field)
W - insert an ICU Date (in a field)

Each of these brings up a spotlight-like dialog that helps you easily find and insert the corresponding item.

4 Likes

Ah, I guess I haven't got enough macros to slow it down yet. :sweat_smile:

1 Like

Wow, that is such a nugget!

2 Likes

Make sure you review the Keyboard Maestro Editor and scope out its other menu items and keyboard shortcuts.

There are more such nuggets...

:sunglasses:

1 Like