Flow control with an empty cell in google sheets

I have a script that copies text from google sheet cells and pastes into track names in Avid Protools. Currently I am having difficulty getting the script to stop its loop once it copies an empty cell. ATM I am trying to test to see if a variable is now empty and no longer has text, but I'm pretty sure whatever I am doing is incorrect since the script wants to keep going indefinitely.

Any pointers or suggestions would be greatly appreciated!

Probably hard to get a response before you show what you are doing.

Here's the current code attached.

Build track names from input sheet.kmmacros (20.1 KB)

It looks like an empty google sheet cell contains a carriage return and is not empty, but I'm not sure how to match that. Screenshot attached for reference.

Perhaps you should try the match parameter of the Variable condition. I did a quick test, and I think this works, but you should do a more thorough test.

image

What this will do, I believe, is find a match (ie, evaluate as true) if the variable (Somedata) contains zero or more newlines, and nothing else.

Thank you for your help. I tried this and it only runs successfully one time even though I have verified the variables have non-newline characters. I'm at a loss. I wish I understood how to use regex better! I am attaching my latest code in case it helps.
Build mixer track names from input sheet.kmmacros (36.0 KB)

When matching a known, fixed, character or string a regex is pointless complexity -- just use:

image

Regex is for when you have a "pattern" that can vary -- "I want to match a, followed by any single digit, followed by b".

Actually, I see two mistakes in your IF statement. Your if statement tries to match this string:

(?s)^(n)"$

when I told you to match this string:

(?s)^(\n)*$

This was the little bit of code I needed! That— and some more thoughtful looping logic. Thank you for your assistance!

Attached is the final version of my program in cause you're curious.
Build mixer track names from input sheet.kmmacros (24.5 KB)