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

ExtendScript Debugger Visual Studio Code Link to Photoshop App

New Here ,
Jan 01, 2024 Jan 01, 2024

I am trying out scripting Photoshop, I am experienced using Visual Studio but not the code version, I have also written in Javascript many times but the environment around using VS Code and the ExtendScript Debugger is causing me issues.  I'm using ExtendScript Debugger with VS Code 1.85.1, running under Windows 10.  I've run scripts directly from Photoshop and they have worked, however, I want to use the debugger running in Visual Studio Code and have been following tutorials from various sources. I'm just testing to see that I can link to Photoshop and get some basic information back about layers. The following is my code so far:

main();
function main(){
   alert("Hello");
   var doc=app.activedocument;
   var myWindow = new Window("palette","My Window",undefined);
   myWindow.orientation="row";

This launches ok and pops up an alert window in Photoshop. But is then should pop up a window but doesn't. There are no errors, however, intellisense does not have app and the code app.activedocument appears to be ignored. I have also not been able to find myWindow.show() which I think is what will display to window. Possibly I have missed a step in setting up VS Code.

TOPICS
Windows
988
Translate
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

correct answers 1 Correct answer

Community Expert , Jan 01, 2024 Jan 01, 2024

Basic error, JS/ES is case-sensitive, camelCase:

 

var doc=app.activedocument;

 

 

var doc=app.activeDocument;

 

 

Translate
Adobe
Community Expert ,
Jan 01, 2024 Jan 01, 2024

Basic error, JS/ES is case-sensitive, camelCase:

 

var doc=app.activedocument;

 

 

var doc=app.activeDocument;

 

 

Translate
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 ,
Jan 01, 2024 Jan 01, 2024

Consider Photoshop's support of

 

new Window("palette"

 

vs.

 

new Window("dialog"

 

https://creativepro.com/files/kahrel/indesign/scriptui.html

 

https://extendscript.docsforadobe.dev/user-interface-tools/window-object.html

 

The window type. The value is:

  • dialog - Creates a modal dialog.

  • palette - Creates a modeless dialog, also called a floating palette. (Not supported by Photoshop CC.)

  • window - Creates a simple window that can be used as a main window for an application. (Not supported by Photoshop CC.)

 

https://indd.adobe.com/view/a0207571-ff5b-4bbf-a540-07079bd21d75

 

https://www.davidebarranca.com/2012/10/scriptui-window-in-photoshop-palette-vs-dialog/

 

 

EDIT: I would forget about ScriptUI windows for the moment, just concentrate on basic scripting first, adding the legacy ScriptUI code into the mix is going to seriously complicate your early learning.

Translate
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 ,
Jan 02, 2024 Jan 02, 2024
LATEST

Yep, palette will popup a window that vanishes. Use dialog type for a floating window in Photoshop.

Translate
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