Skip to content

Commit 05a4be1

Browse files
committed
Merge branch 'Dev'
2 parents c740fe0 + c1daf35 commit 05a4be1

10 files changed

+82
-125
lines changed

.eslintrc.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"no-unreachable": "warn",
1919
"no-unused-vars": "warn",
2020
"constructor-super": "warn",
21-
"valid-typeof": "warn"
21+
"valid-typeof": "warn",
22+
"semi": "warn"
2223
}
23-
}
24+
}

.vscodeignore

-8
This file was deleted.

CHANGELOG.md

+46-33
Original file line numberDiff line numberDiff line change
@@ -6,124 +6,137 @@ All notable changes to the Adobe Script Runner extension will be documented in t
66

77
### Added
88

9-
*
9+
-
1010

1111
### Changed
1212

13-
*
13+
-
1414

1515
### Fixed
1616

17-
*
17+
-
1818

1919
### Removed
2020

21-
*
21+
-
22+
23+
---
24+
25+
## [0.4.0] 2021-03-09
26+
27+
### Added
28+
29+
- Option to toggle **Bring Host Application To Front** on execution for Mac.
30+
31+
### Changed
32+
33+
- Updates default paths for Illustrator and Photoshop for Windows to 2021 application version.
34+
- Updates default path for After Effects for Windows to 2020 application version.
2235

2336
---
2437

2538
## [0.3.0] 2019-12-12
2639

2740
### Added
2841

29-
* Option to always **Execute File From Config** file defined in **Execute This** section, ignoring the one in active viewer.
30-
* Option to **Execute File From Token** `Adobe-Script-Runner "path/to/file.jsx"` in active document to execute file between the quotes.
42+
- Option to always **Execute File From Config** file defined in **Execute This** section, ignoring the one in active viewer.
43+
- Option to **Execute File From Token** `Adobe-Script-Runner "path/to/file.jsx"` in active document to execute file between the quotes.
3144

3245
### Changed
3346

34-
* Codebase rewritten from scratch.
35-
* Renamed configuration keys and titles.
47+
- Codebase rewritten from scratch.
48+
- Renamed configuration keys and titles.
3649

3750
### Removed
3851

39-
* Checkbox **Run Untitled**.
52+
- Checkbox **Run Untitled**.
4053

4154
---
4255

4356
## [0.2.1] 2019-01-05
4457

4558
### Changed
4659

47-
* Updates default Windows paths to CC2019 version.
48-
* Updates descriptions for `Run Untitled`, `Save Dirty`, and `Temp File` in extensions Settings window.
60+
- Updates default Windows paths to CC2019 version.
61+
- Updates descriptions for `Run Untitled`, `Save Dirty`, and `Temp File` in extensions Settings window.
4962

5063
---
5164

5265
## [0.2.0] 2018-03-29
5366

5467
### Fixed
5568

56-
* Fixed bug when settings were not registered until app restart.
57-
* Fixed issue with HOME "~/" paths.
69+
- Fixed bug when settings were not registered until app restart.
70+
- Fixed issue with HOME "~/" paths.
5871

5972
### Changed
6073

61-
* Changed code flow. Splits everything into modules for easier maintenance and development. Also makes it easier for other apps to adopt the functionality.
62-
* Ports functionality to [Atom.io](https://atom.io/packages/adobe-script-runner).
74+
- Changed code flow. Splits everything into modules for easier maintenance and development. Also makes it easier for other apps to adopt the functionality.
75+
- Ports functionality to [Atom.io](https://atom.io/packages/adobe-script-runner).
6376

6477
---
6578

6679
## [0.1.2] 2018-03-14
6780

6881
### Added
6982

70-
* Default keybinding `Cmd+R` ro tun `adobeScriptRunner.ae` command.
71-
* Instructions on how to assign keybindings to commands in `README.md` file.
83+
- Default keybinding `Cmd+R` ro tun `adobeScriptRunner.ae` command.
84+
- Instructions on how to assign keybindings to commands in `README.md` file.
7285

7386
---
7487

7588
## [0.1.1] 2018-03-14
7689

7790
### Changed
7891

79-
* Extension icon.
92+
- Extension icon.
8093

8194
---
8295

8396
## [0.1.0] 2018-03-13
8497

8598
### Added
8699

87-
* Support to execute scripts in `Adobe InCopy`.
88-
* Support for Windows.
100+
- Support to execute scripts in `Adobe InCopy`.
101+
- Support for Windows.
89102

90103
---
91104

92105
## [0.0.3] 2018-03-12
93106

94107
### Added
95108

96-
* Support to open scripts inside `Adobe ExtendScript Toolkit`.
97-
* Looping gif to README.md file that looks amazing.
109+
- Support to open scripts inside `Adobe ExtendScript Toolkit`.
110+
- Looping gif to README.md file that looks amazing.
98111

99112
### Fixed
100113

101-
* Fixed typos in `README.md`.
114+
- Fixed typos in `README.md`.
102115

103116
### Changed
104117

105-
* Updated `extension.js` to use es6 syntax.
106-
* Updated info message to show app name the script has been sent to.
107-
* Renamed settings object `adobeScriptLauncher` to `adobeScriptRunner`.
108-
* Changed location of temp file `Snippet.js` to `~/.vscode` instead of `~/Desktop` folder.
109-
* Created `resources` folder to dump all image files there.
118+
- Updated `extension.js` to use es6 syntax.
119+
- Updated info message to show app name the script has been sent to.
120+
- Renamed settings object `adobeScriptLauncher` to `adobeScriptRunner`.
121+
- Changed location of temp file `Snippet.js` to `~/.vscode` instead of `~/Desktop` folder.
122+
- Created `resources` folder to dump all image files there.
110123

111124
---
112125

113126
## [0.0.2] 2018-03-11
114127

115128
### Added
116129

117-
* Support to execute scripts in `Adobe Illustrator`.
118-
* Support to execute scripts in `Adobe InDesign`.
130+
- Support to execute scripts in `Adobe Illustrator`.
131+
- Support to execute scripts in `Adobe InDesign`.
119132

120133
### Changed
121134

122-
* README.md and CHANGELOG.md files to reflect changes.
123-
* Refactored `scriptCommands` object.
135+
- README.md and CHANGELOG.md files to reflect changes.
136+
- Refactored `scriptCommands` object.
124137

125138
---
126139

127140
## [0.0.1] 2018-03-10
128141

129-
* Initial release
142+
- Initial release

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,18 @@ The file path gets resolved by joining this path and the Workspace (or Root `/`)
8585

8686
## Settings
8787

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

9090
- `adobeScriptRunner.executeFileFromConfig`: Whether to execute file, defined in config `.vscode/settings.json` file. See more in [Execute this](#execute-this) section.
9191
- `adobeScriptRunner.executeFileFromToken`: Whether to search for `Adobe-Script-Runner "path/to/file.jsx"` token in active document, and execute file within the quotes. See more in [Token](#token) section.
9292
- `adobeScriptRunner.executeThis`: A path to a file to execute always, ignoring the file in the viewer, globally or per-project basis. See more in [Execute this](#execute-this) section.
9393
- `adobeScriptRunner.saveFileBeforeExecution`: Whether to save file before execution.
9494
- `adobeScriptRunner.temporaryFile`: Path to a temporary file where Untitled document gets saved prior to execution.
9595

96+
**For Mac users only:**
97+
98+
- `adobeScriptRunner.bringHostApplicationToFront`: Whether to bring the host application to the front. If this option is turned off, then the **debug console** prints `1` if there were execution errors, otherwise `0`.
99+
96100
**For Windows users only:**
97101

98102
- `adobeScriptRunner.winAfterEffectsExe`: path to Adobe After Effects executable (AfterFX.exe).

jsconfig.json

-14
This file was deleted.

lib/getShellCommand.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,18 @@ const ide = require('./ide.js');
1010
function getShellCommand(hostApp, scriptFile, callback) {
1111
const applicationName = hostApp.appName;
1212
const platform = process.platform;
13+
const settings = ide.config.get();
1314

1415
let command = hostApp[platform];
1516
if (!command) {
1617
throw ide.showInformationMessage(`${applicationName} is not hooked-up to work with ${platform} os.`);
1718
}
1819

19-
if (platform === 'win32' && command.includes('{appExe}')) {
20+
if (platform === 'darwin' && command.includes('{activate}')) {
21+
const activate = settings.bringHostApplicationToFront ? 'activate' : '';
22+
command = command.replace('{activate}', activate);
23+
} else if (platform === 'win32' && command.includes('{appExe}')) {
2024
// InDesign and InCopy does not expose 'appExe' in settings - they are launched via Visual Basic magic.
21-
const settings = ide.config.get();
2225
const appExe = settings[hostApp.appExe];
2326
if (!appExe || !file.exists(appExe)) {
2427
throw ide.showErrorMessage(`Unable to find ${applicationName} executable defined in settings. Make sure you have that path set-up correctly.`);

lib/hostApps.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,40 @@ const hostApps = [
22
{
33
'shortName' : 'ae',
44
'appName': 'Adobe After Effects',
5-
'darwin': `osascript -e 'tell application id "com.adobe.aftereffects" to activate DoScriptFile "{scriptFile}" with override'`,
5+
'darwin': `osascript -e 'tell application id "com.adobe.aftereffects" to {activate} DoScriptFile "{scriptFile}" with override'`,
66
'win32': `"{appExe}" -r {scriptFile}`,
77
'appExe' : 'winAfterEffectsExe',
88
},
99
{
1010
'shortName' : 'ai',
1111
'appName': 'Adobe Illustrator',
12-
'darwin': `osascript -e 'tell application id "com.adobe.illustrator" to activate do javascript file "{scriptFile}"'`,
12+
'darwin': `osascript -e 'tell application id "com.adobe.illustrator" to {activate} do javascript file "{scriptFile}"'`,
1313
'win32': `"{appExe}" -r {scriptFile}`,
1414
'appExe' : 'winIllustratorExe',
1515
},
1616
{
1717
'shortName' : 'estk',
1818
'appName': 'Adobe ExtendScript Toolkit',
19-
'darwin': `osascript -e 'tell application id "com.adobe.estoolkit-4.0" to activate open "{scriptFile}"'`,
19+
'darwin': `osascript -e 'tell application id "com.adobe.estoolkit-4.0" to {activate} open "{scriptFile}"'`,
2020
'win32': `"{appExe}" -run {scriptFile}`,
2121
'appExe' : 'winExtendscriptToolkitExe',
2222
},
2323
{
2424
'shortName' : 'ic',
2525
'appName': 'Adobe InCopy',
26-
'darwin': `osascript -e 'tell application id "com.adobe.InCopy" to activate do script "{scriptFile}" language javascript'`,
26+
'darwin': `osascript -e 'tell application id "com.adobe.InCopy" to {activate} do script "{scriptFile}" language javascript'`,
2727
'win32': `powershell -command "$app = new-object -comobject InCopy.Application; $app.DoScript('{scriptFile}', 1246973031)"`, //http://jongware.mit.edu/idcs6js/pe_ScriptLanguage.html
2828
},
2929
{
3030
'shortName' : 'id',
3131
'appName': 'Adobe InDesign',
32-
'darwin': `osascript -e 'tell application id "com.adobe.InDesign" to activate do script "{scriptFile}" language javascript'`,
32+
'darwin': `osascript -e 'tell application id "com.adobe.InDesign" to {activate} do script "{scriptFile}" language javascript'`,
3333
'win32': `powershell -command "$app = new-object -comobject InDesign.Application; $app.DoScript('{scriptFile}', 1246973031)"`, //http://jongware.mit.edu/idcs6js/pe_ScriptLanguage.html
3434
},
3535
{
3636
'shortName' : 'psd',
3737
'appName': 'Adobe Photoshop',
38-
'darwin': `osascript -e 'tell application id "com.adobe.photoshop" to activate do javascript file "{scriptFile}"'`,
38+
'darwin': `osascript -e 'tell application id "com.adobe.photoshop" to {activate} do javascript file "{scriptFile}"'`,
3939
'win32': `"{appExe}" -r {scriptFile}`,
4040
'appExe' : 'winPhotoshopExe',
4141
},

package.json

+17-13
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "adobe-script-runner",
33
"displayName": "Adobe Script Runner",
44
"description": "Run Adobe scripts from VSCode",
5-
"version": "0.3.0",
5+
"version": "0.4.0",
66
"publisher": "renderTom",
77
"icon": "resources/icon.png",
88
"galleryBanner": {
@@ -56,6 +56,11 @@
5656
"type": "object",
5757
"title": "Adobe Script Runner configuration",
5858
"properties": {
59+
"adobeScriptRunner.bringHostApplicationToFront": {
60+
"type": "boolean",
61+
"default": true,
62+
"markdownDescription": "Mac only: Whether to bring the host application to the front."
63+
},
5964
"adobeScriptRunner.executeFileFromConfig": {
6065
"type": "boolean",
6166
"default": true,
@@ -83,7 +88,7 @@
8388
},
8489
"adobeScriptRunner.winAfterEffectsExe": {
8590
"type": "string",
86-
"default": "C:/Program Files/Adobe/Adobe After Effects CC 2019/Support Files/AfterFX.exe",
91+
"default": "C:/Program Files/Adobe/Adobe After Effects 2020/Support Files/AfterFX.exe",
8792
"description": "Windows only: Path to Adobe After Effects executable (AfterFX.exe)."
8893
},
8994
"adobeScriptRunner.winExtendscriptToolkitExe": {
@@ -93,12 +98,12 @@
9398
},
9499
"adobeScriptRunner.winIllustratorExe": {
95100
"type": "string",
96-
"default": "C:/Program Files/Adobe/Adobe Illustrator CC 2019/Support Files/Contents/Windows/Illustrator.exe",
101+
"default": "C:/Program Files/Adobe/Adobe Illustrator 2021/Support Files/Contents/Windows/Illustrator.exe",
97102
"description": "Windows only: Path to Adobe Illustrator executable (Illustrator.exe)."
98103
},
99104
"adobeScriptRunner.winPhotoshopExe": {
100105
"type": "string",
101-
"default": "C:/Program Files/Adobe/Adobe Photoshop CC 2019/Photoshop.exe",
106+
"default": "C:/Program Files/Adobe/Adobe Photoshop 2021/Photoshop.exe",
102107
"description": "Windows only: Path to Adobe Photoshop executable (Photoshop.exe)."
103108
}
104109
}
@@ -120,19 +125,18 @@
120125
"Photoshop",
121126
"InDesign"
122127
],
123-
"scripts": {
124-
"postinstall": "node ./node_modules/vscode/bin/install",
125-
"test": "node ./node_modules/vscode/bin/test"
126-
},
127128
"repository": {
128129
"type": "git",
129130
"url": "https://github.com/rendertom/VSCode-Adobe-Script-Runner.git"
130131
},
132+
"scripts": {
133+
"package": "vsce package"
134+
},
131135
"devDependencies": {
132-
"typescript": "^2.6.1",
133-
"vscode": "^1.1.6",
134-
"eslint": "^4.11.0",
136+
"@types/mocha": "^2.2.42",
135137
"@types/node": "^7.0.43",
136-
"@types/mocha": "^2.2.42"
138+
"eslint": "^4.11.0",
139+
"vsce": "^1.85.1",
140+
"vscode": "^1.1.6"
137141
}
138-
}
142+
}

test/extension.test.js

-24
This file was deleted.

0 commit comments

Comments
 (0)