Split array
hi,
i m trying to split name of track through live api - but the problem is really my lack of js skills
This gives you the current track name in m4l/Ableton:
var trackname = liveObject.get("name");
log("name:", liveObject.get("name") );
var s = trackname.toString();
Let say, my track is named
"AUDIO 1" -
i only try to split the string of elements : "AUDIO" and "1"
(to evaluate each of them later).
i can't manage to pass it from within js while this would be easy as argument from outside.
I d like to create 2 new var from the string
var a = "AUDIO"
var b = "1"
It considers the whole as a string, so only one argument (i m so bad to js!)
any help?
thx1
I always have to post on the forum, to find the answer. Here you go
var a = "AUDIO 2"
var words = a.split(' ');
var a = words[0]
post("a",a,"\n");
var b = words[1]
post("b",b,"\n");