Copy link to clipboard
Copied
Is there a post somewhere that only shows a script to Copy / activeDocument's Keywords?
I found other posts, but they are out of the scope of what im looking for. I just need a simple scripts for this.
Copy activeDocument's Keywords via script. Insert sed copied keywords to the next activeDocument's keywords area. Which I'll likely activate manually. That's no biggie.
That does not sound efficient, but what the hey … you could try this:
var myDoc = activeDocument;
copyTextToClipboard(myDoc.info.keywords.join(", "));
function copyTextToClipboard( txt ) {
const keyTextData = app.charIDToTypeID('TxtD');
const ktextToClipboardStr = app.stringIDToTypeID( "textToClipboard" );
var textStrDesc = new ActionDescriptor();
textStrDesc.putString( keyTextData, txt );
executeAction( ktextToClipboardStr, textStrDesc, DialogModes.NO );
};
Copy link to clipboard
Copied
This is for Photoshop not bridge.
Copy link to clipboard
Copied
That does not sound efficient, but what the hey … you could try this:
var myDoc = activeDocument;
copyTextToClipboard(myDoc.info.keywords.join(", "));
function copyTextToClipboard( txt ) {
const keyTextData = app.charIDToTypeID('TxtD');
const ktextToClipboardStr = app.stringIDToTypeID( "textToClipboard" );
var textStrDesc = new ActionDescriptor();
textStrDesc.putString( keyTextData, txt );
executeAction( ktextToClipboardStr, textStrDesc, DialogModes.NO );
};
Copy link to clipboard
Copied
No, it definately is not efficient lol. Ill work that out later. I just wanted a simple jump start to what I was trying to accomplish. The rest of the posts are too lengthy and complicated for me to parse apart. I didnt know where to start. Ill keep you posted on the script above. Thank you 🙂
Copy link to clipboard
Copied
Depending on the situation I suppopse you could just insert the keywords in the next image (though what consitutes »next« might be debatable) or raise a dialog to select in which of the open image to insert them.
Copy link to clipboard
Copied
Well... LOL...
I have a few tabs open per set. Each set uses the same keywords. I didnt want to have to open the diaglog, copy keywords, move to next doc, open dialog and paste. If I could just use your copy script above and avoid opening any dialogs and paste w/o opening any diaglogs that would be ideal enough.
Copy link to clipboard
Copied
I don’t understand the situation; do you want to insert the keywords in all open documents?
If not in which one’s?
Copy link to clipboard
Copied
Sorry Sorry, Ignore everything else.
** All i want is your copy code above (which is perfect), and an insert kewords option for the next active document. **
I will figure everything else out later.
Copy link to clipboard
Copied
I guess for more context im going to add the copy meta and paste meta buttons to a script UI dialog i created. Right now, the way it's setup i'd have to fill out all info for all tabs i have opened. Or i can copy the keywords manually and paste them manually. Def not a win win yet lol and no matter what i do , its just efficient enough but not efficient enough type deal.