Select Text, Open Background Tab, Search Website

Well, that is certainly "simple". But it's not really any different from letting the user edit the initialization action for the variable.

I might take your advice to have the user edit the value in an external editor.

KM really could use some sort of sophisticated action for editing variables. There's the fancy app from Dan, but that's overkill for what I need. I'm a wiz with shell scripts, maybe I can send my variable to a shell application for editing.

1 Like

The advantage this provides is that the action takes the user to the macro even if the Keyboard Maestro app is not open. Even if the app is open, the user doesn't have to manually find the macro.

Yes, I like your idea and thank you for it. I haven't decided if it's the best idea for me yet.

1 Like

One thing to consider: How often will the user need to modify the URL list?

The reason I use a text files in Markdown Link Tool is that I need modify the files frequently. There are three or more text files (three initially) in a folder and the following options are available to modify the contents:

I'm sure this would be overkill for your application, but the Edit option could be used. That's done with the Open a File Folder or Application action which opens the file with the default application (in my case BBEdit).

I think I have an idea for implementing an editor here. First, I could use a Prompt with List action to let the user pick which line to edit, then I could use a Prompt for User Input to allow the user to edit the line. In fact, the Prompt for User Input is particularly good because I can use it to display the two independent fields of the line in the file (Display Name,Full Address). The only complexity is that I'd need a special pop-up window to ask the user whether they wanted to Add, Edit or Delete an item from the file.

I think I like this idea very much, because it illustrates how to solve a problem with KM (the lack of a variable editor.)

EDIT -- It seems to be all working, including the editing functions. But before I upload it, I'm going to test it for maybe a day. Here are a few screenshots so you can see what it looks like. Your feedback, even your criticism, is welcome.

Here is the window for adding an entry:

Here are the windows for editing an entry:

Here's the window for deleting an entry:

Here's the window that warns you when you attempt to reset the list to some defaults:

1 Like

Not a KM solution, but the free version of Alfred includes the web search feature and I can't recommend it highly enough for this and many other things.

@Dom,

Here is my suggestion, if I understand your request correctly. You can continue to add to this macro using switch case by adding the other hyper key related keys within the macro. That way you don't have to have separate macros. You can use hyper key-y, hyper key-w and hyper key - l in my examples. Switch case and Trigger value remain the key in my example. If I'm off base, disregard. :smiley:

Selection Search.kmmacros (8.7 KB)

Macro Image

1 Like

@Sleepy, I give you an A+ for creativity!

As I mentioned above, I'd go with a multi-line variable. This simple approach provides the following advantages:

  • No KM logic is required, thus the macro is smaller, faster, and less likely to include bugs.

  • Everyone that has KM knows how to modify a text variable. That is, there is a very small learning curve.

  • Even if the URL is very long, one can see the entire URL without horizontally scrolling.

  • If the order of the URL's needs to be changed, standard cut-and-paste methods can be used.

Your feedback is all wise and welcome (especially the A+ part), but since I've already finished the macro, the deed is done, and I plan to post my macro in the Macros page of this website. It may be a little overkill, but I think the techniques I used for allowing users control over a multi-line variable may be of interest to others. It's actually pretty slick. The code is surprisingly simple and somewhat eclectic in terms of techniques used.

1 Like

I may be missing the objective, but I think you're trying to search for a selected string in one of several search engines or websites. I use a conflict palette for that. The same hotkey is used to trigger each macro. A couple of screenshots should explain it.


That's an interesting and different approach.