rendertom / VSCode-Adobe-Script-Runner

Run Adobe scripts from VSCode
https://marketplace.visualstudio.com/items?itemName=renderTom.adobe-script-runner
87 stars 15 forks source link
after-effects vscode vscode-extension

Adobe Script Runner

Script runner for Adobe applications right from VSCode. Extension available for Atom.io, Sublime Text and VSCode.

Adobe Script Runner

Supported applications

Features

Run commands are accessible via Command Palette. Simply click F1 or Cmd+Shift+P and start typing the name of supported applications. Click enter to run the script inside the selected application.

The extension will open host application first if it's not running, and then execute the script.

Tip: You don't need to have the file saved inside VSCode. The extension will be able to run code from unsaved documents.

Map keyboard shortcuts to execute a script even faster - Cmd+R is bind to run a script inside After Effects by default. Read how to change it in Key bindings.

Adobe Script Runner executes script in the active viewer by default. However, when working with multi-file scripts, it is common to set a path to execute a master file, i.e index.js, from within a file that's in the active view. Such behavior can be modified using Token or setting up execute this file in the settings.

Installation

In action

Key bindings

Keyboard shortcut Cmd+R is bind to adobeScriptRunner.ae command, which will run a script inside Adobe After Effects. To change the command or assign a different shortcut, do the following:

The result should look something like this:

{
  "key": "cmd+r",
  "command": "adobeScriptRunner.ae",
  "when": "editorTextFocus"
},

For more information about keybinding check official Key Bindings for Visual Studio Code.

Token

Use token to execute a different file, rather than the one in the viewer. Add Adobe-script-runner "path/to/file.jsx" at the beginning of the file in the active document to always execute the file between quotes.

/*
  Adobe-script-runner '../../index.js'
  Executes file between quotes rather than the one in the active viewer.
*/

alert('Hello World'); // This line never gets executed, unless `index.js` is referencing the file in viewer.

The file path gets resolved by joining the path of the file in the viewer and the file within the quotes.

Execute this

Use this option to set-up a path to a file to execute always, ignoring the file in the viewer, globally or per-project basis. To do so, open settings (Cmd+, on Mac or Ctrl+, on Windows) and set the path to a file in Extensions -> Adobe Script Runner -> Execute This.

The file path gets resolved by joining this path and the Workspace (or Root /) folder.

Settings

Click Cmd+, on Mac or Ctrl+, on Windows to modify settings. Extension exposes the following API:

For Mac users only:

For Windows users only:

Executable paths for InCopy and InDesign for Windows are not exposed because they are handled differently than the rest of the Adobe apps. Go figure Adobe ¯\_(ツ)_/¯

Known issues