• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

Bridge scripting - Clear And Import Keywords

Explorer ,
Oct 05, 2022 Oct 05, 2022

Copy link to clipboard

Copied

Hi,

I'm new in Bridge scripting (more usual IND or AI).

Is it possible to add into a custom script a "Clear And Import Keywords" function (as located in the Keywords panel).

Do you know an existing script I could target to do this, importing a keyword .txt file and remove existing keywords ? 

Thanks.

 
TOPICS
Scripting

Views

51

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

Community Expert , Oct 05, 2022 Oct 05, 2022

So to be clear, you want to delete all Persistent Keywords and import a new set each time you open Bridge?

If that's the case, there are multiple ways to accomplish this. You could script the deletion and import, you could delete the keyword file and replace it with a new one, or you could manually delete and add keywords. I do not recommend messing with the XML file unless you absolutely have to.

The simplest would be to import a new file. This function can delete existing keywords if desired.

...

Likes

Translate

Translate
Explorer ,
Oct 05, 2022 Oct 05, 2022

Copy link to clipboard

Copied

To complete,

I expect another way, as I need to refresh the keywords list at the opening of Bridge.

So, do you think I can recreate the "Adobe Bridge Keywords.xml" file at the first running of Bridge (working with XML rather than TXT previously expected)?

 

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
Community Expert ,
Oct 05, 2022 Oct 05, 2022

Copy link to clipboard

Copied

So to be clear, you want to delete all Persistent Keywords and import a new set each time you open Bridge?

If that's the case, there are multiple ways to accomplish this. You could script the deletion and import, you could delete the keyword file and replace it with a new one, or you could manually delete and add keywords. I do not recommend messing with the XML file unless you absolutely have to.

The simplest would be to import a new file. This function can delete existing keywords if desired.

 

"App.importKeywordsFromFile (keywordsFile: String , importType: String )

Imports keywords from a file to the Keywords palette.
This is the same as choosing Import from the flyout menu in the Keywords palette.
keywordsFile: Data Type: String or File
The file, specified as a string or ExtendScript File object.
importType (optional): Data Type: String
Whether to replace existing keywords in the palette, or merge these keywords with any existing keywords in the palette.
One of "clearExistingKeywords" or "mergeWithExistingKeywords" (the default)."

 

Try exporting a set of keywords manually to a file to see the text format. You can prepare a keyword file in any text editor, Excel, etc.

 

If you look on my Dropbox, you'll find some utility scripts that deal with keywords. Those may help.

https://www.dropbox.com/sh/mg817g9a9ymbasi/AADTmXUVxmFfM58bcyYE7yiwa?dl=0

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 ,
Oct 06, 2022 Oct 06, 2022

Copy link to clipboard

Copied

Exactly my need! Thank you.

I've finally tried the 2 options : manipulating the XML file or  using"importKeywordsFromFile" method. Both works. I keep the last one of course.

 

I can't find the scripting guide for Bridge. Have you got a document?

 

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
Community Expert ,
Oct 06, 2022 Oct 06, 2022

Copy link to clipboard

Copied

LATEST

Adobe Developer portal

https://developer.adobe.com/

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