sheetjs/demos/extendscript
2017-09-24 19:40:09 -04:00
..
.gitignore lint and type fixes 2017-05-13 14:21:22 -04:00
aftereffects.base version bump 0.9.6 2017-03-25 18:18:50 -04:00
aftereffects.jsx lint and type fixes 2017-05-13 14:21:22 -04:00
estoolkit.base version bump 0.9.6 2017-03-25 18:18:50 -04:00
estoolkit.jsx lint and type fixes 2017-05-13 14:21:22 -04:00
illustrator.base version bump 0.9.6 2017-03-25 18:18:50 -04:00
illustrator.jsx lint and type fixes 2017-05-13 14:21:22 -04:00
indesign.base version bump 0.9.6 2017-03-25 18:18:50 -04:00
indesign.jsx lint and type fixes 2017-05-13 14:21:22 -04:00
Makefile lint and type fixes 2017-05-13 14:21:22 -04:00
photoshop.base version bump 0.9.6 2017-03-25 18:18:50 -04:00
photoshop.jsx lint and type fixes 2017-05-13 14:21:22 -04:00
README.md demo refresh [ci skip] 2017-09-24 19:40:09 -04:00
sheetjs.xlsx version bump 0.9.6 2017-03-25 18:18:50 -04:00
test.jsx lint and type fixes 2017-05-13 14:21:22 -04:00

Adobe ExtendScript

ExtendScript adds some features to a limited form of ECMAScript version 3. With the included shim, the library can run within Photoshop and other Adobe apps!

The main file is test.jsx. Target-specific files prepend target directives. Copy the test.jsx file as well as the shim.js and xlsx.core.min.js files to wherever you want the scripts to reside.

The demo shows opening a file and converting to an array of arrays:

/* include library */
#include "shim.js"
#include "xlsx.core.min.js"

/* get data as binary string */
var filename = "sheetjs.xlsx";
var base = new File($.fileName);
var infile = File(base.path + "/" + filename);
infile.open("r");
infile.encoding = "binary";
var data = infile.read();

/* parse data */
var workbook = XLSX.read(data, {type:"binary"});

/* DO SOMETHING WITH workbook HERE */

NOTE: We forked the minifier and included a patch for ExtendScript's switch statement semicolon issue.

Analytics