Copy link to clipboard
Copied
Does Photoshop's implementation of javascript support the string functions such as split()? I was trying to explode the document file name by the _ character (my filename's contain alot of these). If I can't use split...is there another way to do it?
Yes split is supported...
var str = "This_is_a_test";
str=str.split('_');
alert(str[3]+" "+str[0].toLowerCase()+" "+str[1]);
Copy link to clipboard
Copied
Yes split is supported...
var str = "This_is_a_test";
str=str.split('_');
alert(str[3]+" "+str[0].toLowerCase()+" "+str[1]);
Copy link to clipboard
Copied
Ahh... after you wrote that I went back and reread the documentation....I was attempting to do a split function on the File object as opposed to a string. Silly me.