Skip to main content
Participant
November 8, 2006
Question

Need some help fixing a painfully big mess-up with Keywords tab info of Bridge

  • November 8, 2006
  • 3 replies
  • 1585 views
I am a new Photoshop/Bridge user. Due to a problem with Bridge (not the topic of this post) and a now obviously inadequate backup strategy, I've lost all my metadata keyword definitions from the Keywords tab after reinstalling Bridge. All the keywords are still with the associated photos, but they aren't available in the Keywords tab. When I open a photo subdirectory, the keywords in that directory appear in italic in an alphabetic list under "Other keywords".

Two questions:
1) Is there a fast way I can spider through my photos directory, grab all the keywords I've already used, and re-create the keywords tab info I've already used as an alphabetic list (that I can then create groups from)?
2) Now that I'm "once burned, twice shy" I was wondering if there is a way I can define keywords and keyword sets from a flat file by script so I can "back up" the keywords I have and redefine them at will? (Obviously, ideally this would work both ways--from an external source and to an external source after I've made changes from within Bridge)?

I've tried to address this problem myself with no success. In the interest of full disclosure, I'm more of a cobbler than a scripter/programmer: I'm happy to cobble together cheap-but-effective solutions one kludge at a time (generally by working from sample code). My Photoshopping and scripting have to come out of the same pool of "hobby" time, so i try to automate as much as I can so i can spend more time being creative than massaging files.

I haven't been able to find sample scripts for basic Bridge activities so I'm not very good at scripting Bridge. For example, I'm embarrassed to admit that--despite using every variation of the command examples in the documentation I can come up with--I can't create a new folder, move files, or even change the current document sort by script. I'm not an idiot about scripting (I've had some luck with scripting Bridge, a lot more luck with scripting Photoshop, and I'm a reasonably competent scripter in a couple other languages) but I'm no programmer. I'm sure it's quite straightforward and I'll eventually figure it out, but right now I'm in a bit of a panic about my keywords.

Thanks in advance for any help.
This topic has been closed for replies.

3 replies

Pedro Cortez Marques
Legend
January 25, 2016

Hi

I think you can recreate your default keywords list with scripts.

Just create a script file and save it inside the "startup scripts" folder inside your user preferences.

Folder example on windows, bridgeCC: C:\Users\[user name]\AppData\Roaming\Adobe\Bridge CC\Startup Scripts\

And if you want to go even further, you can also manage to create a listener that detects strange keywords and ask the user if he wants to add it to your default list and where.

To create keywords, just use this script (I add some examples):

//~ app.document.keywordsManager.addKeyword (keywordPath:String, useHierarchicalPath:Bollean)

//~ app.document.keywordsManager.deleteKeyword (keywordPath:String, useHierarchicalPath:Bollean)

//~ app.document.keywordsManager.renameKeyword (oldName:String, newName:String, useHierarchicalPath:Bollean)

//~ app.document.keywordsManager.serializeToXML()

Note regarding sub keywords creation:

when useHierarchicalPath is true, the function will seek the keywordPath string and if it detects a vertical slash (for example "aaa|bbb") that means a keyword "aaa" and a sub keyword "bbb" will be created. "aaa" is created if doesn't exist.

This is the same logic used on deleteKeyword and renameKeyword.

Examples:


addKeyword

app.document.keywordsManager.addKeyword ("some words", true); // adds the keyword "some words"

app.document.keywordsManager.addKeyword ("things|some words", true); // adds the keyword "things" and the sub keyword "some words"

app.document.keywordsManager.addKeyword ("things|some words", false); // this adds the keyword "things|some words" and ignores the vertical dash

deleteKeyword

app.document.keywordsManager.deleteKeyword ("aaa|bbb", true); // delets the sub keyword "bbb"

app.document.keywordsManager.deleteKeyword ("aaa", true); // delets the keyword "aaa" and all its sub keywords

renameKeyword

app.document.keywordsManager.renameKeyword ("aaa|bbb", "aaa|ccc", true); // rename the sub keyword "bbb" to "ccc"

app.document.keywordsManager.renameKeyword ("aaa", "a11", true); // rename the keyword "aaa" to "a11"

serializeToXML

app.document.keywordsManager.serializeToXML(); // returns the xml of all the keywords structure

_Barking_Author
Participant
November 10, 2006
Hi Nigel,

Thanks very much for the resource suggestions--every bit helps!

To clarify my keywords comment, what I meant is that the Keywords panel in Bridge can see the keywords already assigned to the photos in the open bridge document. They all appear under the category "Other Keywords" at the bottom of the panel. I'm assuming those already assigned keywords appear under "Other Keywords" because they are not part of a pre-defined keywords group. If I right-click on one of these keywords (and I can only select one at a time) there is an option to "Make persistent". Apparently italics indicates a lack of persistence. ("Making persistent" is the equivalent of adding a new keyword and it can then be dragged to a keyword group.)

This process gets pretty tedious very quickly because I can only work with one keyword at a time. That's why I was hoping to use a script to automate finding the keywords in the different directories and make them persistent.
Stephen Marsh
Community Expert
Community Expert
January 19, 2016

An old thread, but worth updating, a case a serendipity, I was searching the forum for JavaScript code to recursively scan subdirectories in Bridge…

At least in CS6, keywords live in an XML file. On the Mac, this could be:

/Users/loggedinusername/Library/Application Support/Adobe/Bridge CS6/Adobe Bridge Keywords.xml

By default the contents is:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

<keywords version="2">>

  <set name="Events" disclosed="true">

  <item name="Birthday" />

  <item name="Graduation" />

  <item name="Wedding" />

  </set>

  <set name="People" disclosed="true">

  <item name="Matthew" />

  <item name="Ryan" />

  </set>

  <set name="Places" disclosed="true">

  <item name="New York" />

  <item name="Paris" />

  <item name="San Francisco" />

  <item name="San Jose" />

  <item name="Tokyo" />

  </set>

</keywords>

The “Other Keywords” that are “persistant” (roman text) would appear at the foot of the code shown above (after line 18):

  <set name="Other Keywords" disclosed="true">

  <item name="Additional Keyword" />

  <item name="Another keyword" />

  </set>

The “non persistant” text that is indicated in italics is resident in a selected file, however it is not resident in the Adobe Bridge Keywords.xml file.

To extract the keywords from many files, folders and subfolders, one can use ExifTool:

ExifTool by Phil Harvey

exiftool -r -T -subject '/Users/loggedinusername/Desktop/source_directory/' > exiftool-keyword-dump.txt

The previous command line code is from the Mac, on Windows simply change the single quote ' to double quotes " with the correct platform specific path to the top level folder.

A tab delimited text file titled “exiftool-keyword-dump.txt” would be created in /Users/loggedinusername/ (or an explicit output location could be coded).

One could then manipulate the text file adding XML tags for a set and item and paste this into the Adobe Bridge Keywords.xml file (create a backup of this file first for recovery purposes). You would now have every keyword used in all of your loose files added to the keywords of Adobe Bridge!

Hope this helps somebody in a similar position to the OP.

Stephen Marsh
Community Expert
Community Expert
October 20, 2016

NOTE: Just a quick update, it just makes things harder trying to create a valid XML file, all one really needs to do is make the plain text file output from ExifTool correct for importing into Bridge without all of the XML tags etc.

Participating Frequently
November 9, 2006
Hi Barking

I have done some fairly basic Bridge scripting but have never worked with keywords. I am also not sure what you mean by "the keywords in that directory appear in italic in an alphabetic list under "Other keywords"". Is this a separate text file containing the keywords?

I suggest contacting the some of the very helpful scripters at http://www.ps-scripts.com/bb/ or failing that try another application such as idImager (see www.idImager.com). idImager has great support (see the support forum http://www.ps-scripts.com/bb/) and the author will probably cobble together a script to do what you require.

Regards Nigel