extendscriptkit
Advanced tools
Comparing version 0.1.1 to 0.1.2
'use strict'; | ||
require('./Project'); | ||
Application.prototype.undoable = function (name, cb) { | ||
@@ -4,0 +6,0 @@ app.beginUndoGroup(name); |
{ | ||
"name": "extendscriptkit", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "ExtendScript shims and helpers", | ||
@@ -12,2 +12,3 @@ "main": "index.js", | ||
"babel-preset-es2015": "^6.18.0", | ||
"babelify": "^7.3.0", | ||
"browserify": "^13.1.1" | ||
@@ -17,4 +18,4 @@ }, | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build": "rm -rf jsx && rm -rf js && cd src && babel . -x \".jsx\" --out-dir ../jsx && babel . -x \".js\" --out-dir ../js", | ||
"build-docs": "find src -name '*.md' | xargs cat > API.md" | ||
"build": "npm run build-standalone && rm -rf jsx && rm -rf js && cd src/jsx && babel . --out-dir ../../jsx && cd ../js && babel . --out-dir ../../js", | ||
"build-standalone": "browserify -t babelify src/jsx/standalone.js > ExtendScriptKit.jsx" | ||
}, | ||
@@ -21,0 +22,0 @@ "author": "Koen Schmeets", |
131
README.md
@@ -14,2 +14,4 @@ # ExtendScriptKit | ||
If you don't want to use Browserify, you can download the zip of this repository and use the ExtendScriptKit.jsx bundle (note: untested) | ||
## Features | ||
@@ -44,2 +46,129 @@ | ||
[Go to API.md](API.md) | ||
### AE / Application (JSX) | ||
Adds a couple of helper methods to `AE`'s `Application` prototype. | ||
#### Use | ||
Add the following import to your project's `index.jsx` file: | ||
**index.js** | ||
```js | ||
require('extendscriptkit/jsx/ae/Application') | ||
app.undoable('Some Action Description', () => { | ||
// everything you do within here will be undoable | ||
}) | ||
app.faster(() => { | ||
// code within here that adds or modifies layers or composition will be faster. | ||
// It adds a temporary composition and focuses it so AE doesn't have to do a lot of re-draws. | ||
// After your code in here has ran, the temporary composition will be removed. | ||
}) | ||
``` | ||
### AE / Composition (JSX) | ||
Adds a couple of helper methods to `AE`'s `CompItem` prototype. | ||
#### Use | ||
Add the following import to your project's `index.jsx` file: | ||
**index.js** | ||
```js | ||
require('extendscriptkit/jsx/ae/Composition') | ||
app.project.forCompositions(composition => { // see Project API | ||
composition.forLayers(layer => { | ||
// do something with layer | ||
}) | ||
composition.forSelectedLayers(selectedLayer => { | ||
// do something with selected layer | ||
}) | ||
}) | ||
``` | ||
### AE / Project (JSX) | ||
Adds a couple of helper methods to `AE`'s `Project` prototype. | ||
#### Use | ||
Add the following import to your project's `index.jsx` file: | ||
**index.js** | ||
```js | ||
require('extendscriptkit/jsx/ae/Project') | ||
app.project.forItems(item => { | ||
// do something with item | ||
}) | ||
app.project.forFilteredItems( | ||
item => item.name === 'Test', | ||
item => { | ||
// do something with item named 'Test' | ||
} | ||
) | ||
app.project.forSelections(selection => { | ||
// do something with selection | ||
}) | ||
app.project.forCompositions(composition => { | ||
// do something with composition | ||
}) | ||
app.project.forCompositionsWithName('compy', (composition) => { | ||
// do something with compositions named 'compy' | ||
}) | ||
``` | ||
### Bridge (JS / JSX) | ||
The bridge allows communication between JS and JSX. | ||
On the JSX end it exposes a dispatch(type, data) method and | ||
On the JS end it exposes the CSInterface. | ||
#### Use | ||
Add the following imports to your project's `index.js` and `index.jsx` file: | ||
**index.js** | ||
```js | ||
const bridge = require('extendscriptkit/js/bridge') | ||
bridge.addEventListener('MY_EVENT', data => { | ||
console.log(data) | ||
}) | ||
``` | ||
**index.jsx** | ||
```js | ||
const dispatch = require('extendscriptkit/jsx/bridge') | ||
dispatch('MY_EVENT', 'Hello World') | ||
``` | ||
### Console (JS / JSX) | ||
Shims the console in JSX files. | ||
The `console.log`'s will go to the remote chrome debugger, ExtendScript Toolkit and | ||
the debug log file. | ||
Additionally, `console.error`'s will be written to panel's <body> as well. | ||
#### Use | ||
Add the following imports to your project's `index.js` and `index.jsx` file: | ||
**index.js** | ||
```js | ||
const bridge = require('extendscriptkit/js/bridge') | ||
require('extendscriptkit/js/console')(bridge) | ||
``` | ||
**index.jsx** | ||
```js | ||
require('extendscriptkit/jsx/console') | ||
``` | ||
You can now use `console.log()` and `console.error()` in any JSX file. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
97612
2546
173
7
25
1