[SOLVED] Find specific set of words

I'm going over all my global variables and I want to delete some that are not being used.
I have one called "Image 3" but when I try to search, I get this macro that doesn't have that. I'm guessing KM is looking for "Image" and "3" separately and maybe not just in text I typed in, but also action titles, etc?


Have you tried using quotes?

"Image 3"

Your tip worked for me. Without the quotes it's an AND operation. Thanks.

But one thing about KM has always worried me. Let's say you have this hypothetical one-action macro:


As you can see, it contains the string "888". If you search for 888 it will find this macro. But let's say you change the "and drag to" to "without dragging" so that it reads thusly:


At this point, should a search for 888 result in finding this macro? The text "888" is still in the action because if you change "without dragging" to "and drag to" you get this again:


So since the "888" was always in there, should it be found in a search for "888" (when you've hidden the 888.) Before you test to see the answer, consider what you think is the best behaviour. I would not choose the answer that the KM Editor currently selects.

The search no longer highlights the action when you 'hide' 888. This is the way is should be, in my opinion. I don't think it is 'hiding' the value; I think the value returns if the fields are unhidden. But what do I know?

Well, it makes me afraid to share my macros, because I'm worried that these unseen fields may contain personal information, something like EXIF data that many people don't know is on many of their photos.

In my opinion, the KM Editor should have a feature to "zeroize" all the data in those unseeable fields.

I would presume that the 'unseen' values aren't in the actions, but in the KM cache or local support files.

You can prove me wrong by importing this action into a macro and revealing the and drag to fields.

Move or Click Mouse.kmactions (1.0 KB)

If it does indeed reveal non-zero values, then you're onto something.

The action’s XML can indeed contain information that is not visible to the user.

For example, when an action can output results to a variable, but you then change it to display in a window, the variable that was initially assigned is still part of the action’s XML and will show up in searches.

EDIT: Maybe not all actions, but I have seen this with Execute a macro actions many times.

Hmm. In that case, @Airy raises a very good point.

Having said that, I can't think of any actions with disappearing fields that I might ever enter sensitive information into.

The fields can contain megabytes of data, and there are lots of fields that can be invisible. I haven't made a list.

Sometimes I put a script into an action that can take "either a filename or a script." Later I switch to a filename and the script is still there, hidden behind the scenes. I could accidentally upload an entire program that way.

I'm always conscious of this issue, so I'm not likely to make a mistake. But I'm not so sure about others. In fact, if you go through the Macros page on this website, you might find examples of accidental uploads.

1 Like

I can't think of my own name sometimes.

I always thought it was Noisy Neil. No kidding.

It usually is. Uneditable typo. :man_facepalming:t2:

Yes, I always use that (even with Finder and all that), but sometimes when you get no results, you wonder "did it work, or I'm not seeing any results because this didn't work?"
I was just wondering if that was really the way to do it.
Maybe it is.

I think if a value is hidden, it shouldn't be affected by the search, otherwise you end up looking at the action and have no idea why it's telling you the term you searched for is in that macro.
Another option would be to use a different type of highlight, that way we would know which actions have a visible value and which have a hidden value.

That's not a bad idea, but I still like my idea of a KM Editor feature which deletes all invisible/unused values. It could even be offered at the moment someone tries to upload their macro to this website.

Has anyone gone through macros that have been uploaded to this website to see if anyone has accidentally passed hidden data for the world to see?

Since that information is hidden anyway (it's assumed that we don't want to use it, otherwise we would make it visible), I think that exporting macros should, by default, remove that hidden info. I don't see how having another pop up window is beneficial. If we want that info visible to other users, then we should make it visible, not hide it.

My suggestion when it comes to highlighting it with a different color, would be more for the local user to make it easier to know what we have.

There's no need for another pop-up window, just a checkbox in the Share window that asks if you want to delete invisible information. Which one would you normally pick? Keep or Delete?

What if you use the Export Macro under File?
Or if you right click the macro and use Export Macro?
You always need to implement it in other places as well.

Since I suggested that it should delete by default when exporting macros, for the reasons I mentioned, I would always pick Delete. But again, I don't think there's a need for that extra "step" if you already have the information hidden. If you wanted other to see it, you wouldn't hide it. Or if you want to share another option with the users, just duplicate that action, show the information, disable the action.
I know that this last option takes longer than ticking a box, but since this would be a very particular scenario (if ever, that you want to share info that's hidden), I don't think that adding that option (development-wise) is super necessary.
If I were Peter I would make that a default, to delete that info and if you want to share it, just do what I just suggested.

If that option were to be implemented, I think it would be to have those boxes and we could pick, in the preferences, which one is selected by default and on very particular scenarios we would pick the other one. So for me it would be "Delete" by default. Then if for some odd reason I wanted to make it visible I would select "Keep". But again, I don't see myself having the need to share something that's hidden, to be honest.

I just ran a test where I created a macro with some "hidden" text. I then

  • exported the macro
  • deleted it from KM
  • shut down KM engine
  • shut down KM editor
  • relaunched KM (and by default the KM engine)
  • imported the previously-exported macro
  • examined it for "hidden" data

The macro I created was very simple and looked like this:


I then changed it to this:


This is the macro I then exported, deleted etc as per the steps listed above.

After importing the macro and "revealing" the hidden condition I got this:


which plainly shows the "hidden" data survived being exported and then imported.

Consequently, I'd ask @peternlewis to consider a feature request: actions that have the potential to carry such "hidden" data that persists across the export/import of macros should be wiped clean of such data on export, thereby preventing the private data of KM users being accidentally shared with other users.

I'm glad there's a growing consensus. But we'll have to wait for "The Architect's" opinion. Maybe he will see problems we don't, or maybe he won't see this as an important feature.