split("\n") definitely does work in Scriptable, as you can see if you run this short bit of test code:
a = `First line
b = a.split("\n");
So if it’s “not working” for you, the problem is likely to be either
- The variable you’re applying
split to doesn’t contain the text you think it does.
- The text doesn’t use the linefeed character to separate lines.
Sometimes lines are separated by a combination of carriage return and linefeed characters; less common is a carriage return by itself. It depends on where the text came from. If the separator is the problem, there are ways to handle that.
But, as @schl3ck suggests, without seeing your code or the data it’s operating on, we don’t have enough information to help you.