ps: Im a beginner!
Copy link to clipboard
One method to point to an external JSX file:
Or slightly different syntax:
To run the JS code inline within the AppleScript:
And if there are double quotes in the code, they need to be escaped as shown here:
Good luck Tonio1812 and please let the forum know how it worked out for you!
Hi Stephen! Thank you so much, the first two propositions worked perfetly. Its strange because I remember to have tried something very similar to the second... Maybe I was confuse with the "<" and ">" put in the documentation of Adobe about Applescript scritping. In any case, thank you very much!
Thank you for the feedback, this courtesy is not always shown, correct answers or likes are not always given.
Anyway, your original inline code snippet for the Hello World alert had incorrect syntax. I mentioned this with the reference to using inline JS code within AS:
The double quotes within the JS code need to be escaped with a backslash character \" – I only found this out recently myself, I'm sure it is basic 101 stuff for those used to working with AS.
As JS does not care if one uses double or single quotes (as long as they are consistent in opening/closing code) – the other option is to use single quotes in the JS code, such as:
Then there is no need to escape the single quotes!
Hi, sorry for the delay I just saw your answer now. Thank you for the tip, you probably saved me a lot of time again !
I know it's been a year since this was posted but I just spent an hour trying to find an answer about how to run jsx scripts for photoshop from command line and this is the first answer I've found that worked, so I just wanted to say thank you so much for sharing this!
It took me a lot of time and effort to track down code that worked, it appears that there is a lot of older code on various web pages and forums that no longer works with newer versions of Photohsop. Glad it helped you!