Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Copy text directly from text layer. Works above photoshop cs6. Copy following script file into /Applications/Adobe Photoshop CC 2014/Presets/Scripts (MAC) or C:\Program Files\Adobe\Adobe Photoshop CC 2014\Presets\Scripts (WIN). Assign shortcut for easy access (cmd+option+c / ctrl+alt+c)
* Copy Layer text 1.0 - by Praveen Vijayan! -
* Compatibility above Photoshop CS6
* Licensed under the Creative Commons Attribution 2.5 License -
if(app.activeDocument.activeLayer.kind == LayerKind.TEXT){
const keyTextData = app.charIDToTypeID('TxtD');
const ktextToClipboardStr = app.stringIDToTypeID( "textToClipboard" );
var textStrDesc = new ActionDescriptor();
textStrDesc.putString( keyTextData, app.activeDocument.activeLayer.textItem.contents );
executeAction( ktextToClipboardStr, textStrDesc, DialogModes.NO );

This comment has been minimized.

Copy link

Gettyk commented Nov 19, 2014

I confirm that it doesn't work with CS6, you get that:

Error 8800: General Photoshop error occurred. This functionality may not be available in this version of Photoshop.

  • The command "" is not currently available.
    Line: 16
    -> executeAction( ktextToClipboardStr, textStrDesc, DialogModes.NO );

In that case, you will need that script: (works also with CS3 and CS6)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.