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.
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.
...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)?
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
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?
Copy link to clipboard
Copied
Adobe Developer portal