Can someone please help me debug this macro?

extract xv5080 presets into mediabay.kmmacros (17.3 KB)

everything seems to work fine until the

“Set Variable “Local__CurrentName” to Text “%Variable%Local__PresetList[Local__Iteration]%”

action. that’s when it seems to paste it correctly, but after hitting enter it adds the hole text fine instead of just the line.

thanks so much for any help!

The default pseudo-array delimiter is a comma -- , -- you're trying to use a newline but haven't told it so. Try:

Set Variable "Local__CurrentName" to Text "%Variable%Local__PresetList[Local__Iteration]\n%"

But this isn't a very efficient way of doing what you want, especially since you only use the iterator for array access. Take a look at the "For Each" Action, which you can use to work through your text block one line at a time:

2 Likes