Answered
How to know if a jsx script has been launched from Photoshop or from Applescript?
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.
