README.md 1.1 KB
Newer Older
S
SheetJS 已提交
1
# Adobe ExtendScript
S
SheetJS 已提交
2

S
SheetJS 已提交
3 4
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!
S
SheetJS 已提交
5

S
SheetJS 已提交
6
The main file is `test.jsx`.  Target-specific files prepend target directives.
S
SheetJS 已提交
7
Copy the `test.jsx` file as well as the `shim.js` and `xlsx.core.min.js` files
S
SheetJS 已提交
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
to wherever you want the scripts to reside.

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

```js
/* 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 */
```
S
SheetJS 已提交
30 31

NOTE: [We forked the minifier](https://www.npmjs.com/package/@sheetjs/uglify-js)
S
SheetJS 已提交
32
and included a patch for ExtendScript's switch statement semicolon issue.
S
SheetJS 已提交
33

S
SheetJS 已提交
34
[![Analytics](https://ga-beacon.appspot.com/UA-36810333-1/SheetJS/js-xlsx?pixel)](https://github.com/SheetJS/js-xlsx)