Copy link to clipboard
Copied
Hello,
Is there a way to know if a jsx script has been launched directly from Photoshop or from an Applescript?
I have a jsx which can be launched by an Applescript or directly from Photoshop and I would like to know if it has been launched directly from Photoshop.
AS
set myJSXFile to "/Volumes/SSD/SOUK/test.jsx"
tell application "Adobe Photoshop CS6"
activate
do javascript of file myJSXFile with arguments {"test1", "test2"}
end tell
JSX
if (arguments !== undefined) {
alert("Launched from Applescript");
}else{
alert("undefined arguments: launched from Photoshop."); ///// never executed
}
My problem is that the arguments variable never seems undefined, whether the jsx is launched from Applescript or directly from Photoshop.
Thank you.
alert(arguments.length)
Copy link to clipboard
Copied
alert(arguments.length)
Copy link to clipboard
Copied
Neat!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now