From 4aafcce8be52d2ab6f6a5c1a64c8bf8e7ab75688 Mon Sep 17 00:00:00 2001 From: SheetJS Date: Mon, 30 May 2022 01:04:05 -0400 Subject: [PATCH] extendscript --- .../03-demos/02-extendscript.md | 190 ++++++++++++++++++ .../docs/04-getting-started/03-demos/index.md | 2 +- docz/docs/06-solutions/01-input.md | 2 +- docz/docs/06-solutions/05-output.md | 13 +- docz/docs/07-csf/03-book.md | 4 +- docz/docs/index.md | 4 +- docz/static/files/SheetJS.xlsb | Bin 0 -> 8362 bytes docz/static/files/psparse.png | Bin 0 -> 6210 bytes docz/static/files/pswrite.png | Bin 0 -> 7187 bytes docz/static/live/parse.jsx | 22 ++ docz/static/live/write.jsx | 23 +++ 11 files changed, 248 insertions(+), 12 deletions(-) create mode 100644 docz/docs/04-getting-started/03-demos/02-extendscript.md create mode 100644 docz/static/files/SheetJS.xlsb create mode 100644 docz/static/files/psparse.png create mode 100644 docz/static/files/pswrite.png create mode 100644 docz/static/live/parse.jsx create mode 100644 docz/static/live/write.jsx diff --git a/docz/docs/04-getting-started/03-demos/02-extendscript.md b/docz/docs/04-getting-started/03-demos/02-extendscript.md new file mode 100644 index 0000000..c12764d --- /dev/null +++ b/docz/docs/04-getting-started/03-demos/02-extendscript.md @@ -0,0 +1,190 @@ +--- +sidebar_position: 3 +--- + +# Adobe Apps + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +Photoshop, InDesign and other Adobe Creative Suite applications offer extension +support. Over the years there have been a few different JavaScript platforms: + +- "ExtendScript": This uses an old JavaScript dialect but is supported in older + versions of Creative Suite and Creative Cloud. + +- "CEP": This was recommended in CS6 but eventually deprecated. + +- "UXP": This is the current Adobe recommendation for new CC extensions. + +This demo intends to cover the SheetJS-related parts. General setup as well as +general Adobe considerations are not covered here. A basic familiarity with +extension development is assumed. + +## ExtendScript Scripts + +[Installation is straightforward:](../../installation/extendscript) download a +script and move it to your project directory. + +### Reading Files + +`XLSX.readFile` can directly accept an absolute URI: + +```js +var workbook = XLSX.readFile("~/Documents/test.xlsx"); +``` + +The path can be user-configurable using `File.openDialog`: + +```js +/* Show File Picker */ +var thisFile = File.openDialog("Select a spreadsheet"); +if(!thisFile) { alert("File not found!"); return; } + +/* Read file from disk */ +var workbook = XLSX.readFile(thisFile.absoluteURI); +``` + +
Complete Example (click to hide) + +In this example, the script will show a dialog to select a file. After reading +the file, the workbook Author property will be extracted and the Photoshop doc +author (`activeDocument.info.author`) will be changed accordingly. + +This demo was verified in Photoshop CS6 64-bit on Windows 10. + +```js +#target photoshop +#include "xlsx.extendscript.js"; + +function main_parse() { + /* Show File Picker */ + var thisFile = File.openDialog("Select a spreadsheet"); + if(!thisFile) { alert("File not found!"); return; } + + /* Read file from disk */ + var workbook = XLSX.readFile(thisFile.absoluteURI); + + /* Get Workbook Author */ + var Props = workbook.Props; if(!Props) { alert("Missing Author!"); return; } + var Author = Props.Author; if(!Author) { alert("Missing Author!"); return; } + + /* Change Document Author to Workbook Author */ + var info = activeDocument.info; + alert("Changing Author from |" + info.author + "| to |" + Author + "|"); + info.author = Author; +} + +main_parse(); +``` + +0) Download the [test workbook](pathname:///files/SheetJS.xlsb). + +1) Download the following scripts: +- [`xlsx.extendscript.js`](https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.extendscript.js) +- [`parse.jsx`](pathname:///live/parse.jsx) + +and place in the scripts directory. For CS6 Windows 10 the path is typically + +`C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Presets\Scripts` + +2) Restart Photoshop and open a file (or create a new one) + +3) File > Scripts > parse and select the test workbook + +4) An alert will confirm that the file was read and the author will be changed: + +!["Changing Author" popup](pathname:///files/psparse.png) + +5) File > File Info... should show the updated Author field! + +
+ +### Writing Files + +`XLSX.writeFile` can directly accept an absolute URI: + +```js +XLSX.writeFile(workbook, "~/Documents/test.xlsx"); +``` + +The path can be user-configurable using `File.saveDialog`: + +```js +/* Show File Picker */ +var thisFile = File.saveDialog("Select an output file", "*.xlsx;*.xls"); +if(!thisFile) { alert("File not found!"); return; } + +/* Write file to disk */ +XLSX.writeFile(workbook, thisFile.absoluteURI); +``` + +
Complete Example (click to hide) + +In this example, the script will show a dialog to select an output file. Once +selected, the library will create a new workbook with one worksheet. Cell A1 +will be "Author" and cell B1 will be the active Photoshop document Author. +The PS author is available as `activeDocument.info.author`. + +This demo was verified in Photoshop CS6 64-bit on Windows 10. + +```js +#target photoshop +#include "xlsx.extendscript.js"; + +function main_write() { + /* Show File Picker */ + var thisFile = File.saveDialog("Select an output file", "*.xlsx;*.xls"); + if(!thisFile) { alert("File not found!"); return; } + + /* Create new Worksheet */ + var ws = XLSX.utils.aoa_to_sheet([ + ["Author", activeDocument.info.author] + ]); + + /* Create new Workbook and add worksheet */ + var wb = XLSX.utils.book_new(); + XLSX.utils.book_append_sheet(wb, ws, "Sheet1"); + + /* Write file to disk */ + XLSX.writeFile(wb, thisFile.absoluteURI); + alert("Created File " + thisFile.absoluteURI); +} + +main_write(); +``` + +1) Download the following scripts: +- [`xlsx.extendscript.js`](https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.extendscript.js) +- [`write.jsx`](pathname:///live/write.jsx) + +and place in the scripts directory. For CS6 Windows 10 the path is typically + +`C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Presets\Scripts` + +2) Restart Photoshop and open a file (or create a new one) + +3) File > File Info ... and confirm there is an Author. If not, set to `SheetJS` + +4) File > Scripts > write and use the popup to select the Documents folder. + Enter `SheetJSPSTest.xlsx` and hit "Save" + +4) An alert will confirm that the file was created: + +!["Created File" popup](pathname:///files/pswrite.png) + +5) Open the generated `SheetJSPSTest.xlsx` file and compare to Photoshop author + +
+ +## CEP + +[The standalone scripts](../../installation/standalone) can be added to CEP +extension HTML + +## UXP + +UXP officially recommends `require` and NodeJS Modules for third party support. + +[Use the "Frameworks" instructions to download.](../../installation/frameworks) + diff --git a/docz/docs/04-getting-started/03-demos/index.md b/docz/docs/04-getting-started/03-demos/index.md index 888f974..dd63162 100644 --- a/docz/docs/04-getting-started/03-demos/index.md +++ b/docz/docs/04-getting-started/03-demos/index.md @@ -33,7 +33,7 @@ The demo projects include small runnable examples and short explainers. - [`NW.js`](https://github.com/SheetJS/SheetJS/tree/master/demos/nwjs/) - [`Chrome / Chromium Extension`](https://github.com/SheetJS/SheetJS/tree/master/demos/chrome/) - [`Google Sheets API`](./gsheet) -- [`ExtendScript for Adobe Apps`](https://github.com/SheetJS/SheetJS/tree/master/demos/extendscript/) +- [`ExtendScript for Adobe Apps`](./extendscript) - [`Headless Browsers`](https://github.com/SheetJS/SheetJS/tree/master/demos/headless/) - [`Other JavaScript Engines`](https://github.com/SheetJS/SheetJS/tree/master/demos/altjs/) - [`"serverless" functions`](https://github.com/SheetJS/SheetJS/tree/master/demos/function/) diff --git a/docz/docs/06-solutions/01-input.md b/docz/docs/06-solutions/01-input.md index 69372bc..f45eea3 100644 --- a/docz/docs/06-solutions/01-input.md +++ b/docz/docs/06-solutions/01-input.md @@ -338,7 +338,7 @@ request({url: url, encoding: null}, function(err, resp, body) { }); ``` -[`axios`](https://npm.im/axios) works the same way in browser and in NodeJS: +[`axios`](https://axios-http.com/) works the same way in browser and in NodeJS: ```js const XLSX = require("xlsx"); diff --git a/docz/docs/06-solutions/05-output.md b/docz/docs/06-solutions/05-output.md index 34d2c4d..0899885 100644 --- a/docz/docs/06-solutions/05-output.md +++ b/docz/docs/06-solutions/05-output.md @@ -296,10 +296,10 @@ data grid for previewing and modifying structured data in the web browser. The
Previewing data in a React data grid (click to show) -[`react-data-grid`](https://npm.im/react-data-grid) is a data grid tailored for -react. It expects two properties: `rows` of data objects and `columns` which -describe the columns. For the purposes of massaging the data to fit the react -data grid API it is easiest to start from an array of arrays. +[`react-data-grid`](https://adazzle.github.io/react-data-grid) is a data grid +built for React. It uses two properties: `rows` of data objects and `columns` +which describe the columns. For the purposes of massaging the data to fit the +`react-data-grid` API it is easiest to start from an array of arrays. This demo starts by fetching a remote file and using `XLSX.read` to extract: @@ -336,8 +336,9 @@ export default function App() {
Previewing data in a VueJS data grid (click to show) -[`vue3-table-lite`](https://github.com/linmasahiro/vue3-table-lite) is a simple -VueJS 3 data table. It is featured [in the VueJS demo](https://github.com/SheetJS/SheetJS/tree/master/demos/vue/modify/). +[`vue3-table-lite`](https://linmasahiro.github.io/vue3-table-lite/dist/) is a +simple VueJS 3 data table. It is featured in the +[VueJS demo](https://github.com/SheetJS/SheetJS/tree/master/demos/vue/modify/).
diff --git a/docz/docs/07-csf/03-book.md b/docz/docs/07-csf/03-book.md index c7de881..ee9065c 100644 --- a/docz/docs/07-csf/03-book.md +++ b/docz/docs/07-csf/03-book.md @@ -67,9 +67,9 @@ XLSX.write(wb, {Props:{Author:"SheetJS"}});
Format Support (click to show) -**Defined Names**: XLSX/M, XLSB, BIFF8 XLS, XLML, SYLK +**Simple Defined Names**: XLSX/M, XLSB, BIFF8 XLS, XLML, ODS, SYLK -**Unicode Defined Names**: XLSX/M, XLSB, BIFF8 XLS, XLML +**Unicode Defined Names**: XLSX/M, XLSB, BIFF8 XLS, XLML, ODS **Defined Name Comment**: XLSX/M, XLSB, BIFF8 XLS diff --git a/docz/docs/index.md b/docz/docs/index.md index 45e8f57..217c568 100644 --- a/docz/docs/index.md +++ b/docz/docs/index.md @@ -8,7 +8,7 @@ hide_table_of_contents: true ![License](https://img.shields.io/github/license/SheetJS/sheetjs) [![Build Status](https://img.shields.io/github/workflow/status/sheetjs/sheetjs/Tests:%20node.js)](https://github.com/SheetJS/sheetjs/actions) [![Snyk Vulnerabilities](https://img.shields.io/snyk/vulnerabilities/github/SheetJS/sheetjs)](https://snyk.io/test/github/SheetJS/sheetjs) -[![npm Downloads](https://img.shields.io/npm/dm/xlsx.svg)](https://npmjs.org/package/xlsx) +[![npm Downloads](https://img.shields.io/npm/dm/xlsx.svg)](https://cdn.sheetjs.com/) SheetJS Community Edition offers battle-tested open-source solutions for extracting useful data from almost any complex spreadsheet and generating new @@ -67,7 +67,7 @@ document.getElementById("sheetjsexport").addEventListener('click', function() { function Table2XLSX(props) { /* Callback invoked when the button is clicked */ - const xport = React.useCallback(() => { + const xport = React.useCallback(async () => { /* Create worksheet from HTML DOM TABLE */ const table = document.getElementById("Table2XLSX"); const wb = XLSX.utils.table_to_book(table); diff --git a/docz/static/files/SheetJS.xlsb b/docz/static/files/SheetJS.xlsb new file mode 100644 index 0000000000000000000000000000000000000000..c8f8ff098c1599ba0bfd1e523f3667b0f39ea0b3 GIT binary patch literal 8362 zcmeHsby!qe+y2lUBArTiryvc|3_VCm3?U6egER~wE#07mbV~>fAsj(cDe0C50R@q7 z(DNQV9Dl#>{r-O6eO-IcHP_zj-ZS@lp7q?%y@1L{$b3006L~ z006fE=!ga~jt&s81H?qz%L(ji#OY~ocPAeikvSKD2!H;+$A2&bt=ezZy14OM=??JX zE1BJAkfe)k@PPE3zzEuR6>awU_Zn8+l+RA>M#FPIv5{~_5cpWSpS-8heXgjBU*#ld zZZv0#0a}Hau9KZ-wie>CcQThJ_v-gelE>koH40tyPa`pgG^AFG$zL)fmr^Q4eDtb< z@Ve$D#fx_tdX^Bo;O0+ke#Ba}L#7x5xmHPCl3BXgnDLfwoH8cZnCc(az0y+#t9UzN zGSH#0>gpa5XcZHZ#)wF+Ajg>wDwhON=!*zQ>d{w23%(&>8{>c3qMg0B5Mme9(Yo*X zKv11|oT-S)&Ur8C3}~&;%iArapP;TmcCZ7>uMW-kaC`9);}D_Tka<@+jwFQ3pXbLhGVrhU5E=*6!u5`O>5l zs8y=Xf>6Gm4nx#o8lGXNM)U7DVhobIy`5f#o4CW`axDj?BPC3<=+yxi0aR~CjpKD? zd^&^ECEI-XH|VDGr`&>R;1PIvi39-tEsbS@mU~X&cU0h6iUm(&6Bn?ZD;MY0^}p%+ zADpwl{PpOBA$a;?_wFgQ%B-A!a!^3et8ckeIE&AUx4_^)QUA1nUh?$Bf~lClf$C!K zXeg(3c5tltwXiH(MUb0DkXca=XhLUyq_rYjvPbsaFmnu>uuF)MpMRs@db}oeWZSU@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+#0)GuTUK*i_5(X4G1lcNPm@NZ97StSw#sd zF`Fh`5-bOov05#1PRHUPC)A3yCsi?^GbC9J>gAFWtaDrl)Zf?2bYBt|gN&*$m%Xo?kO%v`hRxZ=YKKRe^B(+KhfZT> z*ToS5kpo@`f4}>9we0+Q{AMo_sQh<;zwdkeI`|Dd9e&vbxjFEr5qv##55D}}u!V09 z{=2z(Jrn={!FN^v-&W^MoSQb+HBvI>Uq9j>rq@lBo379`N;%eVQGTq?H&Jd{DAy>x z*gsHi8Y(vdZYs!Y0Cc$Wfs=BrCvOhDsgkaTnh^aQdQ&sqM7XJet`WL^BK&WP=qBJz zNpTI>Lwu9eUnJJGz_!oXPgm%ob1b^S&8S$}WT-kU%1?^Wps>Yo=F*)Onv)+nGd$`8?j2j7$-MFs$T IDX$*>AFZ4PGynhq literal 0 HcmV?d00001 diff --git a/docz/static/files/psparse.png b/docz/static/files/psparse.png new file mode 100644 index 0000000000000000000000000000000000000000..11e56ff1f6bb61de871327ffdd6ebd3d93215aea GIT binary patch literal 6210 zcmdrwc~sI{w^-i1cFnq#&1#dB+SS6;a%|K{Krf1#ish6!p{an1U|nyMWfrJh9I_HM z93Ur55xr$vT52KU6wX6}V2OY;5AXMVZ@u-_d+WVF-mu7EnJ ze#81*>j4132JnS*Z~$P^nl)6mlZKxxWP zOFlm+$LbLmE=2(V+ILoem6WmX0RX`EF7Ub2E-~IBKD200SGL;V;?Fb6Z(Z$-QO>Dz z8aqZqHP*i|OxdTQ(G!!Fed=eQZ6m6q`!=n4bK>Wn0X{$bMf`YkZ({k5yDvY+1e~=q zi}5MTIEg?n%Ss!T38%V$g%Z{jD)2T-Fc}hEuvRX^vC6#`;awH zQ#oT3^>dA^X}0;Xba<)D2@w(Vv8Zh)Hu{hfjexT-+RrK?A zTxE~NX3K(hssydIH(#3;HFN5sD}@Vd^9kfcL1+0eeShrK5fVW5;%fVORXEW^e-0A& zL|n2zXrdpaex-i@%_MU5C;eG53Fw$->}@qb*y<}heYfP`S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SM-P2LRdk_z^{}BMrD0gQr qk?NxVoyPWm!}~oJzbsX(o$=rDv&u`>Ic47;06q^pM?Z7rw|@eS2nO2# literal 0 HcmV?d00001 diff --git a/docz/static/files/pswrite.png b/docz/static/files/pswrite.png new file mode 100644 index 0000000000000000000000000000000000000000..4a793f5f7617940349630753c12e4c547c798333 GIT binary patch literal 7187 zcmd^EcT`hZw~vDZ3Id~GivlVtiWH?q`T!~-5R{HIQKkU$6ogM^aMk`Q=t=6mzKwccOfT5r9w-XC|}bM`%Z-`_sxckbDH-`{V7 zO~pllq5uFu-0b=lYXIP+*hPT^iWuC*qfZsmrO5K`(k*u zYmXSkxhLId<>@26j}}RDX6lYo&tBP=pWL?_TFF{$hPU)wbJ9EdXr+C0WZEn5my=1C zc1h`Wotk=eX{5_d|Iwk_y;+5@`iA+Tg86w;%#yC%5<4%+%^_PS6dXFtp%BP5OJg|0 zmN~;6j%qYj%zbP6Fm5$pmH#5%Fi^j0|F#VAg_=j&=A`OmG4sLB?srq~b&KF8F^jNV zF`gP#QZ9M<{_`{X>D2cu_sztLsBMYN^A-0pVYLMNTwq4njOCDt@;O*W0p^boff5(zK&i+mYKo=wWyjsyH!GNS<) zG6xI&iv1TFpJQ>GZ8$yNf`gns_p*M@Nok3Or!oZEg*OC1nfvvLNnSW^XH~tg=k@$e zrN5pP3Z5OF^KRx`joJhFnKY3tH7s&4N2`a?{Yqr61_~NWooI^Lo>B|Y>uQU%VKND} zTFyPxl@sp>fF3pV7^@?LMusR=Ie#H;Sc+`+>Gp(f#wNS9Sr?TqyVRmNvw9FA`YUtY zYuVRC=Nmo5qL?&ynE%k%dan6iZeY9INeOXWr2~)MeqB1(0EHg01sw7?^}ChqppgQK z^tn*WwNyIx0c!b4$Cut<;KNpF_NI=p&gg8&EF(CT9&k4*7^*G)xw+i737I6p;;b%2 z)HODKi=8NDdsKjR+QUDB&R@3pLY8idF|Qe$*pnLS22Wh`q-(&4NqC$&JbpF=ebp%$ zm>+0R>u0meF)L8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hH)%VP8^5?7&<{Iv STJR$eV0IOJrPTP&<9`EO$bqH+ literal 0 HcmV?d00001 diff --git a/docz/static/live/parse.jsx b/docz/static/live/parse.jsx new file mode 100644 index 0000000..e9269b7 --- /dev/null +++ b/docz/static/live/parse.jsx @@ -0,0 +1,22 @@ +#target photoshop +#include "xlsx.extendscript.js"; + +function main_parse() { + /* Show File Picker */ + var thisFile = File.openDialog("Select a spreadsheet"); + if(!thisFile) { alert("File not found!"); return; } + + /* Read file from disk */ + var workbook = XLSX.readFile(thisFile.absoluteURI); + + /* Get Workbook Author */ + var Props = workbook.Props; if(!Props) { alert("Missing Author!"); return; } + var Author = Props.Author; if(!Author) { alert("Missing Author!"); return; } + + /* Change Document Author to Workbook Author */ + var info = activeDocument.info; + alert("Changing Author from |" + info.author + "| to |" + Author + "|"); + info.author = Author; +} + +main_parse(); \ No newline at end of file diff --git a/docz/static/live/write.jsx b/docz/static/live/write.jsx new file mode 100644 index 0000000..97794a2 --- /dev/null +++ b/docz/static/live/write.jsx @@ -0,0 +1,23 @@ +#target photoshop +#include "xlsx.extendscript.js"; + +function main_write() { + /* Show File Picker */ + var thisFile = File.saveDialog("Select an output file", "*.xlsx;*.xls"); + if(!thisFile) { alert("File not found!"); return; } + + /* Create new Worksheet */ + var ws = XLSX.utils.aoa_to_sheet([ + ["Author", activeDocument.info.author] + ]); + + /* Create new Workbook and add worksheet */ + var wb = XLSX.utils.book_new(); + XLSX.utils.book_append_sheet(wb, ws, "Sheet1"); + + /* Write file to disk */ + XLSX.writeFile(wb, thisFile.absoluteURI); + alert("Created File " + thisFile.absoluteURI); +} + +main_write(); \ No newline at end of file