Colleague Johan asked whether someone could knock up a script which exports all text layers from a Photoshop document to a text file. Since I’ve scripted Photoshop before (heck, I even steered Photoshop from within C#) it was no biggie for me to knock up a simple script, which I dubbed
After Johan placed his request, I quickly knocked up a script which loops all layers (1.0), then (pretty important) expanded it to loop groups of layers too (1.1) and finally added some user friendly stuff like giving one the option to choose where to save the file holding all text elements (1.2).
Update November 2008:
PS_BRAMUS.TextExport is outdated and has been replaced with
PS_BRAMUS.TextConvert which does both import and export!
Installation / How to use
PS_BRAMUS.TextExportfrom the link above
- Extract it to Presets/Scripts folder of your Photoshop installation folder (defaults to C:\Program Files\Adobe\Adobe Photoshop CS3\Presets\Scripts on Windows)
- Restart Photoshop if it was already running
- Open the PSD you wish to export text from
- Now, when having a file opened, go to File > Scripts and select PS_BRAMUS.TextExport.1.2 from the list.
- Wait until the output file appears 🙂
Three settings in
PS_BRAMUS.TextExport can be configured, all to be found in the
.jsx file itself.
- Open up
PS_Bramus.TextExport-1.2.jsxwith your favorite texteditor
- If you want to choose where to save the file to, set
true. If set to
false(default), the output file will be saved into your documents folder
- If you don’t want the exported file to be openend after the export has run, set
false. If set to
true(default), the output file will automatically be opened by your default text editor.
- In the export file, each line is separated by a
separatorstring. Change this one to use one you like (defaults to
PS_BRAMUS.TextExport with a pretty complex PSD, which holds the design of 3RDS. Here are the results:
Make a donation
It certainly is no obligation but it would most certainly put a smile on my face 😉