I recently wrote a follow up script to the last set of Export/Import text scripts for Photoshop I did a while back. I found in my actual day to day usage of the script it was rare that I wanted to dump all the text layers in a file, what I really wanted was to be able to copy the text to the clipboard so I could take it wherever I wanted. So that’s what I did. This script takes the active layer, if a text layer, and exports it to the clipboard.
Unfortunately this script is OS X(Mac) only, though it should be easy for me, or others, to port to XP. Not sure about Windows 7, and I don’t have access to a copy of Photoshop on Win7 anyway. As for OS X, the script requires running another shell script to actually copy the text to the clipboard. To make this work you have to create a shell script with executable permissions BEFORE you run your jsx, which I’ve outlined in the instructions. I’ve even written a handy applescript to do it for you if you are so inclined.
Instructions (MAC only):
First Setup Shell Script
1. Run setupClipScript (linked above)
— OR —
1. Open Terminal
2. Type “echo ‘’ > $HOME/Documents/clipScript.command” and hit enter
3. Type “chmod 755 $HOME/Documents/clipScript.command” and hit enter
Next Copy Script
Copy it to your system and choose “File > Scripts > Browse…” and select the script you want to run
— OR —
1. Place script in ‘/Applications/Adobe\ Photoshop\ CS#/Presets/Scripts/’
2. Restart Photoshop
3. Choose File > Scripts > psdExportTextL_Clipboard
Normal safety warning here: PLEASE SAVE YOUR FILES BEFORE YOU RUN SCRIPTS. I did suspend/save history state for the script, but things can still go bad and often do.
Scripts are only written with CS3 and above in mind, but I only verified them in CS3 on os x.
You can download the script here (right click and choose “Save As” to download).
Next I’ll probably add XP support, just didn’t have as much need as I primarily work on os x. The script has the annoying side effect of leaving open terminal windows open every time it’s executed. Maybe there is some way I can get rid of these, but they are a minor price to pay, for me anyway. Still haven’t figured out why my Photoshop executes scripts differently when I shortcut them. I bypassed this issue by “shortcutting” them via actions instead. Anyway, enjoy the js magic.