How to Find Where Named Clipboards are Embedded?

Howdy folks, hoping those who understand/use named clipboards more than I do can help with this.

I am trying to simplify some macros and wanted to switch from using a named clipboard to a variable for several of them. But I cannot for the life of me find which macro(s) contain that named clipboard.

I go and manually delete it and this warning appears:

Deletion Warning Screenshot (click to expand/collapse)

But I have searched everywhere I can think of and cannot find a single instance of that clipboard in any of my macros. When I search, I search for "Agent Name" and every macro that has those words appear. But I also have a variable titled "Agent Name", and every single macro that appears in the search results references the variable, not the clipboard.

So what is the best way to search for named clipboards, and in this case only named clipboards?

I've been banging my head against the wall all week trying to find this pesky clipboard. :sweat_smile:

Thanks in advance!

-Chris

Hmm.

Does searching named Agent Name help? I guess it would depend on the actions using the named clipboard, and whether you've renamed them.

For example, I think searching named Agent Name would bring up all macros with the action Copy System Clipboard to Named Clipboard “Agent Name” while not pulling up macros with actions containing the variable Agent Name (unless the term named appears elsewhere in the macro). Not perfect, but may help narrow things down. Maybe :slight_smile:

Searching within KM worked for me, but perhaps you could try the following?

  1. Make a new macro with a very distinctive name, single action, "Copy to named clipboard you are trying to find"
  2. Open ~/Library/Application Support/Keyboard Maestro/Keyboard Maestro Macros.plist in a text editor
  3. Search for very distinctive name

You'll get something like

                            ...
							<string>ClipboardSwitcherMacroAction</string>
							<key>Name</key>
							<string>1C5B6DB0-BB5C-4556-8F0E-2061AF87A48D</string>
							<key>RedundandDisplayName</key>
							<string>Agent Name</string>
							<key>TimeOutAbortsMacro</key>
							<true/>
						</dict>
					</array>
					<key>CreationDate</key>
					<real>680950230.78255105</real>
					<key>ModificationDate</key>
					<real>680950334.54495502</real>
					<key>Name</key>
					<string>Named Clipboard</string>
					<key>Triggers</key>
                    ...

...where the last line contains your very distinctive name.

The string 12 lines up from the very distinctive name -- 1C5B6DB0-BB5C-4556-8F0E-2061AF87A48D in this example -- looks to be the named clipboard UUID. Search for that, and for each occurrence scroll to the next <Key>Triggers</key> line -- the macro name will be the line above that.

It's a kludge, but it worked OK in a quick test. If this was something you wanted to do regularly you could probably whip up something to automate it...

I've tried several things like that to no avail. I did eventually find the macro it was embedded in (somehow I overlooked it because the action wasn't highlighted for some reason).

That's a good idea. I actually built a macro sometime back to search the KM plist file to see what files are embedded in macros (like images, AppleScript files etc.) and I imagine I could do something similar to find named clipboards. Thanks for the idea!

Link to that macro if you're interested in checking it out (click to expand/collapse)

Link to that macro if you're interested in checking it out