Stumped by what should be a simple text insertion task

I'm trying to come up with a KM macro which simply inserts a # character followed by a space and then by 158 Light Shade characters, thus forming a simple but attractive function divider for my Python and Mojo scripts.

The problem is that when the macro is triggered by ⌃⌥ Space, only the first 25 or so characters are printed.

I've tried breaking the task down into chunks...

but it's the same result. Only 25 characters are printed.

What am I missing here? :wink:

Try leaving it at a single character, but use Insert Test by Pasting, not typing (that's what I use in my comment-block inserter). Alternatively, add a Set Simulate Normal Keystroke Delay "for this macro" to something like 0.10 seconds.

-rob.

Thanks! I'll give that a go. I had a feeling that like so many KM tasks, timing and dealing with hardware processes might be an issue!

In fact, the Insert Text by Pasting was the key thing here. It was a bit glacial with one character at a time, but with this, it positively flew. Thanks so much :pray:t2:

Why not just paste everything in one go, rather than do 158 Repeats? If nothing else, it'll be a lot faster!

This should do what you want, including a linefeed at the end, and then clear the Clipboard so it's back to its previous contents:

Insert Divider.kmmacros (2.2 KB)