How to split by cursor position?

I have a long text on my editor field and I want to split it by where my cursor position is in the text.

Any workaround for this? What character do I put on the split by to detect cursor postion?

Thanks

Uploading: image.png…

Hi there, @hirayaleads… I can’t imagine the split by operator can detect the cursor position, so you’re probably out of luck there. You might be able to hack something together using this plugin, though.

It gives you a workflow action that enables you to insert something at the cursor position, so maybe you could use a workflow to insert a special character/string and then split by that character/string. Anyway, it’s just a thought… and probably not a good one… but it couldn’t hurt to play around with the idea a bit.

Best…
Mike

1 Like

Yes. I am playing with it now.

The only problem is that I have to click a button so it triggers to show a caret

How can I do it where I just clicked the cursor somewhere in the editor without triggering any buttons?

I almost have something working that uses the concept in this post.

So, you have a hidden (and transparent) button or shape on the page, and you have a conditional on the button/shape that makes it visible when the text input is focused. Then, you use the Do when condition is true workflow to insert a character at the cursor position (via the plugin) when the button/shape is visible. With that setup in place, the character will be inserted at the cursor position when the user clicks in the input field.

There are definitely loose ends with the suggestion above, not the least of which is I didn’t go all the way down the path of trying to split by the inserted character (and the fact that the character is inserted as the first character when the user first clicks in the field). But, the suggestion does get some of the way down the path, and I hope it helps so you can take it the rest of the way.

This topic was automatically closed after 70 days. New replies are no longer allowed.