Copy link to clipboard
Copied
Hi Adobe Community,
Finally with some time on my hands, I'm trying to sink my head into using JSX with Photoshop and my install for ExtendScript fails. I come to find Adobe doesn't support ExtendScript any longer. So can I run VS Code's Package extension without it? As it seem like my only option besides Notepad.
Also, is there any easy install tutorials involving Photoshop out there? I can't seem to find any that aren't really involved. If possible just want to know how to use VS Code to get Photoshop to alert "Hello World", from there I can run tests, but I can't seem to just get setup without errors etc.
Thanks a bunch for any response!
Copy link to clipboard
Copied
Extendscript is I believe all 32Bit code therefore will not be supported on a newer Mac. When you run a Photoshop you do not use Extebscript or VS Code. Scripts are more computer programs source code then they are programs. Scripts are text files you do not need ExtendScript or VS Code to develop Photoshop Scripts. You just need a text editor. I do not user a MAC
Both ExtendScript and VS Code have built is text editors they are sensitive to scripting languages syntax like VSB and JavaScript. While I have ExtendScript and VS Code installed on My Windows PC I do not use either of them to develop and test Photoshop Script. I never got VS Code and the Extentscript add onns working correctly on my PC and I dislike ExtendScript. For I'm Dyslexic and when I use extendscript UI to develop and test Photoshop scripts there are too many windows where things are changing all the times, they are more a distraction then helpful. and I have also encountered problems in Extendscript implmentation where the problem I had was in extendScript not my script.
One also need the use Action Manager code to script Photoshop for Adobe DOM does not cover all Of Photoshop features. Action Managers code is complex and nor very readable oe easy toe create. Thankfully Adobe Provides a Photoshop Plug-in Scriptlistener which is more or less a Script Recorder like the Action Palette is an Action recorder and editor. However, Script recorder has no controls or editing capability. It just records Photoshop Steps like the action recorder . These Steps have recorded steps settings that are not variable. Step. Step. Step.... no logic just sequences of fixed Photoshop steps.
However, using a Text editor you can change the Action Manager code recorded to have variable setting and add logic to perform the steps in a logical way to perform procedure you want automated.
So you may ask what do I use to develop Photoshop Script. First I chose to user JavaScript for I want my scripts to work on both PC and Mac. That a problem for me for I never thought myself JavaScript. I never had the need to learn it while I was employed as a Programmer. I use others programming languages. Because I was a Programmers over the years I used many Programmings language and operating systems. So without knowing JavaScript I can more or less read Javascript code and understand what is going on and with the help of some manuals I can modify existing script code. So I need to doe a lot of searching.
So I need a text Editor. I use NotePad++ it is freeware has syntax highlighting for Java and has spell checking.
Now Action Mangers code is ugly and not something I want to learn to code. So I need to install Adobe Plug-in Scriptlistener. However, it has no controls or editing feature and it records ugly code. So I wrote DOS bat file to give me some controls for the Scriplistener-in and add an edit feature. Still the scriptlistener Action manager coder is ugly not something you want to use. fortunately a very good javascript coders posted Javascript in this forum that can clean up the Scriptlisener recorded code into Javascript functions the are not that difficult to read and use. He also added code to remove some unusable junk code thet it records for me. So I intergraded that script into my Photoshop Scripting work flow. My entire Photoshop Script development work-flow is tied together by an Photoshop extension JSX Launcher a free extension on Adobe exchange. This adds a Extension Panels to Photoshop that is like a one ScriptSet you can run Scripts from. You cans easily change the ScriptSet from its fly-out menu. So I have a collection of scripts sets I use developing Photoshop scripts. The main development set contains the Scriptlisener cleaner and the scripts I currently working on. Other set in the collection contains utilities and scripts that lets me examine Document I'm developing script to work on.
Copy link to clipboard
Copied
Setting up VS Code does indeed take some work. Some links which I hope will help include:
https://extendscript.docsforadobe.dev/vscode-debugger/getting-started-with-vscode-debugger.html
https://www.youtube.com/watch?v=CnYDiWxShR4
https://www.youtube.com/watch?v=L7AfZel_nYM
https://www.youtube.com/watch?v=a90H-Pf61LQ
Copy link to clipboard
Copied
Yes, yes yes!!
I found this one as well: https://www.youtube.com/watch?v=CnYDiWxShR4 (listed second above).
That one is perfect for any craetive types trying to get things just set up and rolling without any errors and have no clue about app building/debugging. Brass tacks, no multi-tasking, upper-level "here's what you can do while skipping 2-3 major things you need first" tutorial. Awesome.
I found this one that was a real boon: https://youtu.be/EvUDLbxGzmE
...It introduces ScriptListener like JJMack mentioned above, but doesn't step you through getting started. I'm on a Mac which I understand leaves me handicapped in attaining ExtendScript at all. So I'm left with the VS Code environment which is actually pretty nice for a novice like me.
One thing that I ran into which was frustrating was the launch.json / hello.jsx wouldn't load in the app even open. It would just stall during run/debug. I found in my extensions that I also installed ExtendScript itself along with the ExtendScript Debugger extension. I uninstalled ExtendScript and I think that fixed the problem. I still have to make the application (PSD, AE, etc.) active in focus in order for the script to run, but it works.
Thanks you guys, I think I'm up and running JSX files in VS Code, way cool!!
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Do not miss "Clean SL" script by Tomas Sinkunas https://community.adobe.com/t5/photoshop-ecosystem-discussions/clean-sl/m-p/9358420
Also the Photoshop extension "JSX Launcher" https://exchange.adobe.com/creativecloud.details.12096.jsx-launcher.html
If you use Windows you may find my DOS Bat file to control the Scriptlistenet Javescript Log file handy. I set the VSB log files attribute to read only it is nevers written to. "Control ScriptListener.bat"
@Echo Off
:loop
CLS
rem Display Log File Size
Dir "%USERPROFILE%\Desktop\ScriptingListenerJS.log" /T:W /4 | find "%ScriptingListenerJS.log"
rem Display Log Attributes R read only Locked no R log is Unlocked
Attrib "%USERPROFILE%\Desktop\ScriptingListenerJS.log"
Rem If timeout is use the above display lines will refresh over time else you need to use enter or number
CHOICE /C 123456 /N /T 300 /D 6 /M "Enter:1 to Lock, 2 to Unlock, 3 to Edit, 4 to Clear, 5 To Exit :"
Echo %ERRORLEVEL%
if %ERRORLEVEL%==6 goto timeout
if %ERRORLEVEL%==1 goto one
if %ERRORLEVEL%==2 goto two
if %ERRORLEVEL%==3 goto three
if %ERRORLEVEL%==4 goto four
if %ERRORLEVEL%==5 goto five
goto loop
:timeout
goto loop
:one
Attrib +R "%USERPROFILE%\Desktop\ScriptingListenerJS.log"
goto loop
:two
Attrib -R "%USERPROFILE%\Desktop\ScriptingListenerJS.log"
goto loop
:three
Rem inline command use CMD independate command use start
CMD /C notepad "%USERPROFILE%\Desktop\ScriptingListenerJS.log"
rem Start notepad "%USERPROFILE%\Desktop\ScriptingListenerJS.log"
goto loop
:four
Rem If the script log file is unlocked not read only this echo will clear it
rem Attrib -R "%USERPROFILE%\Desktop\ScriptingListenerJS.log"
Echo. > "%USERPROFILE%\Desktop\ScriptingListenerJS.log"
goto loop
:five
EXIT
Copy link to clipboard
Copied
Awesome you guys, thanks so much!
Copy link to clipboard
Copied
I run Windows I can and have both ExtendScript and VS Code with the Extendscript Extension installed and usable.
I never liked ExtendScript UI. All I use in it is its Object Viewer. And I had issues in Extendscript when I did used it to debug with with some scripts.
I can set brake points and run Photoshop script via VS Code UI. However, I do not know how to use all the features VS code has or know its UI or how all of it fits together. I do not know much about json which seems to be used within the VS Code environment. So I do not use VS Code to run and debug Photoshop scripts.
I just use scripts alerts to see what is going on and to pause scripts so I can have a look around. I only Hack at Photoshop scripting it not my job it just something the keeps my brain thinking. I do not want it to retire on me.
Copy link to clipboard
Copied
I'm a Mac person so I'm at the behest of what's available on that side of the pond.
The ScriptListener/Clean SL combo is looking to be pretty formidable in the realm of access and return scripting back into form though.
Copy link to clipboard
Copied
There was a good active one on the web only its ghost is still online https://www.ps-scripts.com/ Mike passed away. Paul gave up on Adobe, and X does not seem very active these days. Kukurykus is active here as well as there. The code and information the is still good.
About VS Code if you have a complex project I'm sure you will find it very useful Being able to set break points, watch list call stack to step through your script is great and it running feedback is very helpful. I'm just lazy I do not want to learn how to use it well. It a bit awkward to use when I do not know its UI and debugging environment. I look at it from time to time it may grow on me.
I do not do web development I have never used an Artboard and even removed its tool from my toolbar. I'll be no help when it comes toe Artboards.....
Copy link to clipboard
Copied
Tomas Sinkunas is not the Tom
Copy link to clipboard
Copied
Tomas Sinkunas seems to be into video sill he createe Clean SL the great four use with Photoshop Scriptlistenet. I made a bad jump equating PSSCRIPTS, TOM, Clean SL and renderTom as One.
Copy link to clipboard
Copied
Hey JJMack,
Sweet, thanks for the site reference. I hear ya, go with what you know.
I can't stand artboards. I work in digital advertising production and working in an environment where i can't 'crop' is ridiculous. For me, the artboard is this decade's fascination of building HTML in tables instead of div tags. Artboards are great for presentation, but just non-functional for production. We should really be building in layer comps and then presenting in artboards, not the other way around, but it's not going to change since mobile apps and shared layout prototyping currently runs the world.
So working with automation that can remove them en masse will be great. 🙂
Copy link to clipboard
Copied
app.runMenuItem(stringIDToTypeID("ungroupLayersEvent"));
Copy link to clipboard
Copied
Sweet, thanks Stephen.