Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Console.log" with Photoshop Scripting - ExtendedScript Toolkit

I'm doing a bit of Photoshop scripting for the first time and it sure would be great to have a console.log-like function to output array and object values in the Javascript console of the ExtendScript Toolkit App.

Is there an equivalent function?

like image 993
Sebastien Avatar asked Dec 17 '11 14:12

Sebastien


People also ask

How do I debug a Photoshop script?

After selecting it, the version of Photoshop will show in the bottom bar of the window. Next, click the Debug button on the left-hand side of the window to open the left-hand pane. Click the Run button then select "ExtendScript Debug" from the drop-down window.

How do I use scripts in Photoshop?

In Photoshop, open a document you're working on. Select File > Scripts > Browse and locate your script (or one of the sample scripts if you haven't plucked up the courage to create your own yet). All being well, your script will open and execute.

How do I view scripts in Photoshop?

Go to File > Scripts > Browse. Navigate to your script, and then press open. Your script will immediately run. If you would like to see your script in this script menu, then you need to copy it into the appropriate folder.

What is scripts in Photoshop?

Photoshop scripts are a little like actions, but rather than simply being able to replay a series of steps, scripts can make conditional decisions during processing, which means they can be more intelligent.


2 Answers

$.writeln() is what you're looking for. See the JavaScript Tools Guide (PDF) for details.

like image 102
Daniel Serodio Avatar answered Oct 11 '22 17:10

Daniel Serodio


I'm using ExtendScript Toolkit version 4.0, and using _print('foo') seems to do the trick.

like image 23
Cas Avatar answered Oct 11 '22 19:10

Cas