Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Copy ActiveDoc's Keywords | Script

Explorer ,
Jul 21, 2021 Jul 21, 2021

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.

TOPICS
Actions and scripting, macOS

Views

89

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , Jul 21, 2021 Jul 21, 2021
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 ); };

Likes

Translate

Translate
Explorer ,
Jul 21, 2021 Jul 21, 2021

Copy link to clipboard

Copied

This is for Photoshop not bridge.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 21, 2021 Jul 21, 2021

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 ); 
    };

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 21, 2021 Jul 21, 2021

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 🙂

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 21, 2021 Jul 21, 2021

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. 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 21, 2021 Jul 21, 2021

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. 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 21, 2021 Jul 21, 2021

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? 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 21, 2021 Jul 21, 2021

Copy link to clipboard

Copied

LATEST

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. 

 

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 21, 2021 Jul 21, 2021

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.

Screen Shot 2021-07-21 at 10.17.54 AM.png

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines