Copy link to clipboard
Copied
Hey everyone,
I'm using indesign script which is ( .jsx ) and it's totally diffrent from (.js). Anyhow, are there any alternative for [ includes() or and comparing string function??]. I've tried
if ("somedata" in path)
but it passes every time even if it's not in!
i want to compare between image pathes.
thanks all.
Look at the String.indexOf and String.match methods here: https://www.indesignjs.de/extendscriptAPI/indesign-latest/#String.html
if (str1.indexOf("str2") >= 0 )
or
if (str1.match(/regularExpression/)
Copy link to clipboard
Copied
Look at the String.indexOf and String.match methods here: https://www.indesignjs.de/extendscriptAPI/indesign-latest/#String.html
if (str1.indexOf("str2") >= 0 )
or
if (str1.match(/regularExpression/)
Copy link to clipboard
Copied
Thanks! it worked for me!
Copy link to clipboard
Copied
Also:
Make sure you really have a string in your path variable and not a folder or a file object.
Regards,
Uwe Laubender
( ACP )