atom-to-photoshop

Atom to Photoshop is an extension for Atom to execute a JSX file in Photoshop.

javieraroche

650

0

2.0.1

MIT

GitHub

Atom-to-Photoshop

npm-image

Description


Atom to Photoshop is an extension for Atom that allows you to execute a JSX file in Photoshop.

How to Install


Search for the Atom-To-Photoshop package in Atom.

Usage


This extension works on Atom's current document.

If your file is saved, the extension will execute the script using its local path, otherwise it will execute it through a temporary file.

Click on the atom-to-photoshop > Run menu item, or hit the shortcut ctrl-alt-shift-p to execute your script.

Shortcuts:

Include external files


If your script file is saved, the extension will load your script path and execute it. This makes it easier to use ExtendScript's #include to load relative external files.

#include "~/Development/personal/descriptor-info/jsx/descriptor-info.jsx"

If your file is not saved, the extension will execute your script through a temporary file, making it impossible to load external relative files using #include. Absolute paths will always work.

Polyfills


atom-to-photoshop includes by default 3 JavaScript polyfills, which you can use in your code at any time.

Log to the console


This extension has an internal module that recreates JavaScript's console module, including a way to log a JSON.stringify response.

You can use functions in your code such as:

console.log( 'Hello' );
// Returns: [log: 16:16:2.649] Hello

console.info( 'Hello' );
// Returns: [info: 16:16:23.823] Hello

console.error( 'Hello' );
// Returns: [error: 16:16:37.985] Hello

console.stringify( { foo : 'bar' } );
// Returns: [stringify: 16:16:50.185] {
    "foo": "bar"
}

This extension also allows the use of ExtendScript's native $.write and $.writeln functions to log to the console using JSON.stringify.

$.writeln( "Hello" );
// Returns: [log: 16:20:34.337] "Hello"

$.write( "Hello" );
// Returns: [log: 16:20:37.171] "Hello"

Anatomy of a log


Successful execution

function foo() {
    return app.name;
}
foo();
// Returns: [11:10:02] Result: Adobe Photoshop

Breakdown:

console.log

console.log( 'Hello' );
// Returns: [log: 11:10:02.649] Hello

Breakdown:

Error in execution

return app.name;
// Returns: [11:10:02] 78:256: execution error: Adobe Photoshop CC 2015 got an error: General Photoshop error occurred. This functionality may not be available in this version of Photoshop.
- Error 30: Illegal 'return' outside of a function body.
Line: 1

Breakdown:

Console


A console will show up at the bottom of your editor displaying any messages returned from the executed script. Errors will display in red.

atom-to-photoshop-console

Known Limitations


Changelog


Atom to Photoshop Changelog

License


MIT © Javier Aroche