Use Delimited Text to Drill Down Through Menu Structure

Is there a way to split delimited text and replace the delimiter with an action (for example, a simulated hotkey)? I'm trying to step through a folder menu.

For this example, the text would be:

Legacy, Logic, 05 Keyboards, 01 Electric Pianos, Stage Piano MkII

(The delimiter is a comma followed by a space.)

This is what I've tried so far:

I split the text into variables and paste each one, followed by a Right Arrow simulated keystroke, like so:

The trouble with this is that if the number of folder steps in your text string doesn't match the Insert Text actions in your macro, things can go a bit squiffy.

I've set up a Comma Count +1 group that would figure out the number of folder steps from the text:

Would it be possible to use this number to set up a repeat wherein the variable to be typed would increment? In other words, the first repeat would type %PresetFolder_01% followed by a Right Arrow, the second would type %PresetFolder_02% and so on... for the number of repeats specified in the Comma Count +1 group?

1 Like

Hey Neil,

Something like this?

-Chris


Split Text – Iterate through Lines v1.00.kmmacros (8.6 KB)

Hey Neil,

You do realize you can do something like this – yes?

Run this with the Keyboard Maestro Editor frontmost to see how it works.

-Chris


Open Menu Item by Variable v1.00.kmmacros (6.1 KB)

Hi Chris,

I think I owe you quite a few pints now! The second one you sent isn't really going to work because the text is passed on from the KMLink Stream Deck plugin as a %TriggerValue% and will have a different number of folder steps each time.

Regarding the first one, please forgive my ape-like ignorance, but I can't tell how I'd apply that to my macro. I set local_DataStr to %Trigger Value% and ran it, and it displayed each comma-separated piece of text in a window.

What I'm hoping to do is:

insert the name of the fist piece of text ("Legacy"), hit the right arrow, insert the next piece ("Logic"), hit the right arrow, and so forth. Finally, once we get to "Stage Piano Mk II" I want to hit enter. Then, if I want to load a different preset, I could use the string, "orchestral, strings, violin" for example, and it would still work despite having a different number of steps.

I'm very sorry if I don't make much sense. I barely grasp most of this, so thanks for being patient, and I'm serious about the pints if you're ever in London!

Hey Neil,

Replace the display text action with the actions that you need for your task.

-Chris

1 Like

:man_facepalming:t2:of course!

Once you point it out, it's so obvious that replacing the character with a line break would make the for each action an option. Brilliant!