---
title: Sheets in Photoshop and InDesign
sidebar_label: Photoshop and InDesign
description: Design documents using InDesign and Photoshop. Leverage spreadsheet data in app extensions using SheetJS. Use your Excel spreadsheets without leaving your Adobe apps.
pagination_prev: demos/cloud/index
pagination_next: demos/bigdata/index
---
import current from '/version.js';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import CodeBlock from '@theme/CodeBlock';
Adobe Creative Suite[^1] applications, including the Photoshop graphics editor
and InDesign desktop publishing software, support JavaScript-based extensions.
[SheetJS](https://sheetjs.com) is a JavaScript library for reading and writing
data from spreadsheets.
This demo uses SheetJS in Creative Suite extensions to import data from
spreadsheet files and export data to spreadsheets. We'll explore how to use
SheetJS scripts in extensions and programmatically interact with documents.
This demo explores three different JavaScript platforms supported in various
versions of Photoshop and InDesign:
- ["ExtendScript"](#extendscript): The ExtendScript platform uses a nonstandard
  JavaScript dialect. It is the only option in older versions of Creative Suite.
- ["Common Extensibility Platform" (CEP)](#cep): This was introduced in Creative
  Suite. App automation uses ExtendScript, but integration logic uses modern JS.
- ["Unified Extensibility Platform" (UXP)](#uxp): This platform supports modern
  JavaScript but has limited support (Photoshop 2021+ and InDesign 2022+)
:::note
This demo was verified in the following deployments:
| App       | Platform     | Date       |
|:----------|:-------------|:-----------|
| Photoshop | ExtendScript | 2023-09-24 |
| InDesign  | ExtendScript | 2023-09-24 |
| InDesign  | CEP          | 2023-09-24 |
| InDesign  | UXP          | 2023-09-24 |
:::
## ExtendScript
[The "ExtendScript" build](/docs/getting-started/installation/extendscript) can
be included from a script in the same directory:
```js
#include "xlsx.extendscript.js"
```
### Reading Files
The SheetJS `readFile`[^2] method can directly accept an absolute URI:
```js
var workbook = XLSX.readFile("~/Documents/test.xlsx");
```
`File.openDialog` shows a file picker and returns a path:
```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.
0) Download the [test workbook](pathname:///files/SheetJS.xlsb).
1) Download the following scripts and move to the scripts directory[^3]:
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:

5) Check the Author field of the document in File > File Info...
  
  
In this example, the script will show a dialog to select a file.  After reading
the file, the script will store data in the document:
- The first Text object in the "Title" TextFrame (the name of the TextFrame in
the Layers window is "Title")  will be set to the name of the first worksheet.
- The data from the first sheet will be added to the "Table Frame" TextFrame.
0) Download the [test workbook](https://sheetjs.com/pres.xlsx) and
[InDesign template](pathname:///extendscript/Template.idml)
1) Download the following scripts and move to the scripts directory[^4]:
2) Open the template
3) Activate the Scripts panel.  Expand the "User" folder and double-click
`esidparse` in the list.
4) In the "Select a spreadsheet" file picker, select the test file `pres.xlsx`
A new table will be added and the title will be the name of the first worksheet.
  
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`.
1) Download the following scripts and move to the scripts directory[^6]:
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 press "Save"
5) An alert will confirm that the file was created:

6) Open the generated `SheetJSPSTest.xlsx` file and compare to Photoshop author
  
  
In this example, the script will show a dialog to select an output file.  Once
selected, the library will scan all text frames for table objects.  Each table
object will be scanned and a new worksheet will be created.
0) Download the [InDesign document](pathname:///extendscript/Filled.idml)
1) Download the following scripts and move to the scripts directory[^7]:
2) Open the document.
3) Activate the Scripts panel.  Expand the "User" folder and double-click
`esidwrite` in the list.  Use the popup to select the Documents folder. Enter
`SheetJSIDTest.xlsx` and press "Save"
4) An alert will confirm that the file was created. Open `SheetJSIDTest.xlsx`
and compare to the InDesign doc.
  
Complete Example (click to hide)
  
0) Download [`com.sheetjs.data.zip`](pathname:///extendscript/com.sheetjs.data.zip)
and extract to a `com.sheetjs.data` subdirectory.
1) Move the entire `com.sheetjs.data` folder to the CEP extensions folder[^10].
If prompted, give administrator privileges.
2) Download and open [`Template.idml`](pathname:///extendscript/Template.idml)
3) Download 
4) Show the extension (in the menu bar, select Window > Extensions > SheetJS)
5) In the extension panel, click "Import from file" and select `pres.xlsx`
After "success" popup, the first worksheet should be written to the file.
  
Complete Example (click to hide)
  
0) Download [`com.sheetjs.data.zip`](pathname:///extendscript/com.sheetjs.data.zip)
and extract to a `com.sheetjs.data` subdirectory.
1) Move the entire `com.sheetjs.data` folder to the CEP extensions folder[^13]:
If prompted, give administrator privileges.
2) Download and open [`Filled.idml`](pathname:///extendscript/Filled.idml)
3) Show the extension (in the menu bar, select Window > Extensions > SheetJS)
4) In the extension panel, click "Export to XLSX" and "Save" in the dialog.
5) A popup will display the path to the generated file.  Open the new file.
  
Complete Example (click to hide)
  
0) Open the "Scripts Panel" folder[^15].
1) Download the following scripts:
Move them to the Scripts Panel folder.
2) Download and open [`Template.idml`](pathname:///extendscript/Template.idml)
3) Download 
4) In the Scripts Panel, double-click "parse". Select the downloaded `pres.xlsx`
in the file picker.
:::caution pass
If the InDesign version does not support UXP, a tooltip shows a message:
> This file is not executable by any supported script language.
It is strongly recommended to upgrade to InDesign 2023.
:::
  
Complete Example (click to hide)
  
0) Open the "Scripts Panel" folder[^18].
1) Download the following scripts:
Move them to the Scripts Panel folder.
2) Download and open [`Filled.idml`](pathname:///extendscript/Filled.idml)
3) In the Scripts Panel, double-click "Write".  Click "Save" in the dialog.
4) When the process finishes, open `SheetJSUXP.xlsx` and verify the contents.