Skip to content

Commit a92a8b8

Browse files
committed
Merge branch 'Dev'
2 parents ca44bba + 3e7d366 commit a92a8b8

19 files changed

+4745
-511
lines changed

.eslintrc.json

+11-22
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
11
{
2-
"env": {
3-
"browser": false,
4-
"commonjs": true,
5-
"es6": true,
6-
"node": true
7-
},
8-
"parserOptions": {
9-
"ecmaFeatures": {
10-
"jsx": true
11-
},
12-
"sourceType": "module"
13-
},
14-
"rules": {
15-
"no-const-assign": "warn",
16-
"no-this-before-super": "warn",
17-
"no-undef": "warn",
18-
"no-unreachable": "warn",
19-
"no-unused-vars": "warn",
20-
"constructor-super": "warn",
21-
"valid-typeof": "warn",
22-
"semi": "warn"
23-
}
2+
"env": {
3+
"browser": false,
4+
"commonjs": true,
5+
"es6": true,
6+
"node": true
7+
},
8+
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
9+
"plugins": ["prettier"],
10+
"rules": {
11+
"prettier/prettier": "error"
12+
}
2413
}

.github/workflows/main.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Install, lint and package
2+
on:
3+
# Triggers the workflow on push or pull-request events for the master and Dev branches
4+
push:
5+
branches: [master, Dev]
6+
pull_request:
7+
branches: [master, Dev]
8+
9+
jobs:
10+
install-lint-package:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Git repository
14+
uses: actions/checkout@v3
15+
16+
- name: Install node
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 14
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Lint codebase
25+
run: npm run lint
26+
27+
- name: Create package
28+
run: npm run package

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.node_modules
2+
3+
# Ignore all Markdown files:
4+
*.md

.prettierrc.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"arrowParens": "always",
3+
"bracketSpacing": true,
4+
"endOfLine": "auto",
5+
"printWidth": 100,
6+
"semi": true,
7+
"singleQuote": true,
8+
"tabWidth": 2,
9+
"trailingComma": "es5",
10+
"useTabs": false
11+
}

.vscode/extensions.json

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
2-
// See http://go.microsoft.com/fwlink/?LinkId=827846
3-
// for the documentation about the extensions.json format
4-
"recommendations": [
5-
"dbaeumer.vscode-eslint"
6-
]
7-
}
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": ["dbaeumer.vscode-eslint"]
5+
}

.vscode/launch.json

+21-23
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,24 @@
33
// Hover to view descriptions of existing attributes.
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
{
6-
"version": "0.2.0",
7-
"configurations": [
8-
{
9-
"name": "Extension",
10-
"type": "extensionHost",
11-
"request": "launch",
12-
"runtimeExecutable": "${execPath}",
13-
"args": [
14-
"--extensionDevelopmentPath=${workspaceFolder}"
15-
]
16-
},
17-
{
18-
"name": "Extension Tests",
19-
"type": "extensionHost",
20-
"request": "launch",
21-
"runtimeExecutable": "${execPath}",
22-
"args": [
23-
"--extensionDevelopmentPath=${workspaceFolder}",
24-
"--extensionTestsPath=${workspaceFolder}/test"
25-
]
26-
}
27-
]
28-
}
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"runtimeExecutable": "${execPath}",
13+
"args": ["--extensionDevelopmentPath=${workspaceFolder}"]
14+
},
15+
{
16+
"name": "Extension Tests",
17+
"type": "extensionHost",
18+
"request": "launch",
19+
"runtimeExecutable": "${execPath}",
20+
"args": [
21+
"--extensionDevelopmentPath=${workspaceFolder}",
22+
"--extensionTestsPath=${workspaceFolder}/test"
23+
]
24+
}
25+
]
26+
}

.vscode/settings.json

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
// Place your settings in this file to overwrite default and user settings.
22
{
3-
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe"
4-
}
3+
"[javascript]": {
4+
"editor.defaultFormatter": "esbenp.prettier-vscode",
5+
"editor.codeActionsOnSave": {
6+
"source.fixAll.eslint": true
7+
},
8+
"editor.formatOnSave": true
9+
},
10+
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe"
11+
}

CHANGELOG.md

+15
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@ All notable changes to the Adobe Script Runner extension will be documented in t
2222

2323
---
2424

25+
## [0.6.0] 2022-06-08
26+
27+
### Added
28+
29+
- Support to execute scripts in `Adobe After Effects (Beta)`
30+
- Support to execute scripts in `Adobe Illustrator (Beta)`
31+
- Support to execute scripts in `Adobe Photoshop (Beta)`
32+
- ESLint + Prettier for a consistent codebase
33+
34+
### Changed
35+
36+
- Updates default paths for After Effects, Illustrator, and Photoshop for Windows to 2022 application versions.
37+
38+
---
39+
2540
## [0.5.0] 2021-03-13
2641

2742
### Changed

README.md

+15-7
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ Script runner for Adobe applications right from VSCode. Extension available for
77
## Supported applications
88

99
- Adobe After Effects
10+
- Adobe After Effects (Beta)
1011
- Adobe ExtendScript Toolkit
1112
- Adobe Illustrator
13+
- Adobe Illustrator (Beta)
1214
- Adobe InCopy
1315
- Adobe InDesign
1416
- Adobe Photoshop
17+
- Adobe Photoshop (Beta)
1518

1619
## Features
1720

@@ -28,10 +31,12 @@ Adobe Script Runner executes script in the active viewer by default. However, wh
2831
## Installation
2932

3033
- ### From VSCode application
34+
3135
- Open `Extensions` and type `Adobe Script Runner`.
3236
- Click `Install` and then `Reload` button.
3337

3438
- ### From GitHub
39+
3540
- Download repository and unzip the package.
3641
- Copy `VSCode-Adobe-Script-Runner-master` to `/Users/YOURUSER/.vscode/extensions` folder.
3742

@@ -48,15 +53,15 @@ Keyboard shortcut `Cmd+R` is bind to `adobeScriptRunner.ae` command, which will
4853
- Open Keyboard Shortcuts editor and click on the link `keybindings.json`.
4954
- This will open the Default Keyboard Shortcuts on the left and your `keybindings.json` file where you can overwrite the default bindings on the right.
5055
- With `keybindings.json` in focus click `Cmd+K` twice to open an interactive keybinding modal window (or whatever it’s called) and follow the on-screen instructions. This will create a new binding entry in the `keybindings.json` file.
51-
- Edit the `command` property to `adobeScriptRunner.XX`, where XX is an abbreviation of the application. Check available abbreviations in `Extensions > Adobe Script Runner > Contributions` tab.
56+
- Edit the `command` property to `adobeScriptRunner.XX`, where XX is an abbreviation of the application. Check available abbreviations in `Extensions > Adobe Script Runner > Contributions` tab.
5257

5358
The result should look something like this:
5459

5560
```json
5661
{
57-
"key": "cmd+r",
58-
"command": "adobeScriptRunner.ae",
59-
"when": "editorTextFocus"
62+
"key": "cmd+r",
63+
"command": "adobeScriptRunner.ae",
64+
"when": "editorTextFocus"
6065
},
6166
```
6267

@@ -68,8 +73,8 @@ Use token to execute a different file, rather than the one in the viewer. Add `A
6873

6974
```javascript
7075
/*
71-
Adobe-script-runner '../../index.js'
72-
Executes file between quotes rather than the one in the active viewer.
76+
Adobe-script-runner '../../index.js'
77+
Executes file between quotes rather than the one in the active viewer.
7378
*/
7479

7580
alert('Hello World'); // This line never gets executed, unless `index.js` is referencing the file in viewer.
@@ -100,12 +105,15 @@ Click `Cmd+,` on Mac or `Ctrl+,` on Windows to modify settings. Extension expose
100105
**For Windows users only:**
101106

102107
- `adobeScriptRunner.winAfterEffectsExe`: path to Adobe After Effects executable (AfterFX.exe).
108+
- `adobeScriptRunner.winAfterEffectsBetaExe`: path to Adobe After Effects (Beta) executable (AfterFX (Beta).exe).
103109
- `adobeScriptRunner.winExtendscriptToolkitExe`: path to Adobe ExtendScript Toolkit executable (ExtendScript Toolkit.exe).
104110
- `adobeScriptRunner.winIllustratorExe`: path to Adobe Illustrator executable (Illustrator.exe).
111+
- `adobeScriptRunner.winIllustratorBetaExe`: path to Adobe Illustrator (Beta) executable (Illustrator.exe).
105112
- `adobeScriptRunner.winPhotoshopExe`: path to Adobe Photoshop executable (Photoshop.exe).
113+
- `adobeScriptRunner.winPhotoshopBetaExe`: path to Adobe Photoshop (Beta) executable (Photoshop.exe).
106114

107115
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 ¯\\\_(ツ)\_
108116

109117
## Known issues
110118

111-
- The host application does not get focus on script run.
119+
- The host application does not get focus on script run.

lib/buildCommand.js

+21-21
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,27 @@ const ide = require('./ide.js');
88
* @param {Object} hostApp entry from hostApps[hostApp].
99
*/
1010
function buildCommand(hostApp) {
11-
try {
12-
getScriptFile(function(scriptFile) {
13-
getShellCommand(hostApp, scriptFile, function(command) {
14-
console.log('Running shell command:', command);
15-
cp.exec(command, (error, stdout, stderr) => {
16-
if (error) {
17-
console.error(`exec error: ${error}`);
18-
return;
19-
}
11+
try {
12+
getScriptFile(function (scriptFile) {
13+
getShellCommand(hostApp, scriptFile, function (command) {
14+
console.log('Running shell command:', command);
15+
cp.exec(command, (error, stdout, stderr) => {
16+
if (error) {
17+
console.error(`exec error: ${error}`);
18+
return;
19+
}
2020

21-
console.log(stdout);
22-
console.log(stderr);
23-
});
24-
ide.showInformationMessage(`Script sent to ${hostApp.appName}`);
25-
});
26-
});
27-
} catch (error) {
28-
if (typeof error !== 'undefined') {
29-
console.log(error);
30-
}
31-
}
21+
console.log(stdout);
22+
console.log(stderr);
23+
});
24+
ide.showInformationMessage(`Script sent to ${hostApp.appName}`);
25+
});
26+
});
27+
} catch (error) {
28+
if (typeof error !== 'undefined') {
29+
console.log(error);
30+
}
31+
}
3232
}
3333

34-
module.exports = buildCommand;
34+
module.exports = buildCommand;

lib/extension.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ const vscode = require('vscode');
55
/**
66
* @description Method is called when extension is activated.
77
* Extension is activated the very first time the command is executed.
8-
* @param {any} context vscode.ExtensionContext
98
*/
10-
function activate(context) {
11-
hostApps.forEach(hostApp => {
12-
vscode.commands.registerCommand(
13-
`adobeScriptRunner.${hostApp.shortName}`,
14-
() => buildCommand(hostApp)
15-
);
16-
});
9+
function activate() {
10+
hostApps.forEach((hostApp) => {
11+
vscode.commands.registerCommand(`adobeScriptRunner.${hostApp.shortName}`, () =>
12+
buildCommand(hostApp)
13+
);
14+
});
1715
}
1816

1917
exports.activate = activate;

0 commit comments

Comments
 (0)