Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aalexeev239/22c293c6be438d420b65 to your computer and use it in GitHub Desktop.
Save aalexeev239/22c293c6be438d420b65 to your computer and use it in GitHub Desktop.
/*****************************************************************
*
* Copy Layer text 1.0 - by Praveen Vijayan! - http://www.decodize.com/
*
* Compatibility above Photoshop CS6
*
* Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
*
*****************************************************************/
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 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment