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?
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.
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.
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.
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.
$.writeln()
is what you're looking for. See the JavaScript Tools Guide (PDF) for details.
I'm using ExtendScript Toolkit version 4.0, and using _print('foo')
seems to do the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With