• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Do I need Adobe ExtendScript installed to run VS Code's Extension?

Engaged ,
Dec 27, 2021 Dec 27, 2021

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!

TOPICS
Actions and scripting , macOS

Views

995

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Dec 27, 2021 Dec 27, 2021

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.

Capture.jpg

 

 

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2021 Dec 27, 2021

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 28, 2021 Dec 28, 2021

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!!

 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 28, 2021 Dec 28, 2021

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 28, 2021 Dec 28, 2021

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

 

 

 

 

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 29, 2021 Dec 29, 2021

Copy link to clipboard

Copied

Awesome you guys, thanks so much!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 29, 2021 Dec 29, 2021

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.

image.png

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 29, 2021 Dec 29, 2021

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.

 
In a number of minutes I was able to wrangle up an "Ungroup Artboards" command:
 
// =======================================================
ungroupLayersEvent();
function ungroupLayersEvent() {
var c2t = function (s) {
return app.charIDToTypeID(s);
};

var s2t = function (s) {
return app.stringIDToTypeID(s);
};

var descriptor = new ActionDescriptor();
var reference = new ActionReference();

reference.putEnumerated( s2t( "layer" ), s2t( "ordinal" ), s2t( "targetEnum" ));
descriptor.putReference( c2t( "null" ), reference );
executeAction( s2t( "ungroupLayersEvent" ), descriptor, DialogModes.NO );
}
 
Boom! I have to do this with every signle comp I open up at work. Now if I can just find a way to do it all boards to all files in a folder. That will be the next conquest. 
 
Is there an online repository to share and retrieve JSX scripts at all? There isn't is there?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 29, 2021 Dec 29, 2021

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.....

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 29, 2021 Dec 29, 2021

Copy link to clipboard

Copied

Tomas Sinkunas is not the Tom

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 29, 2021 Dec 29, 2021

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.

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 29, 2021 Dec 29, 2021

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. 🙂

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 29, 2021 Dec 29, 2021

Copy link to clipboard

Copied

app.runMenuItem(stringIDToTypeID("ungroupLayersEvent"));

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 29, 2021 Dec 29, 2021

Copy link to clipboard

Copied

LATEST

Sweet, thanks Stephen.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines