Add the folder names in the path of the image as keywords separated from image metadata

Hi all, I tried to find a solution online and customize the amazing Paul Riggott script, but I'm not able to make it work the way I need.

I have my customer images organized in the structure of folders and subfolders. For all images (thousands of files in the subfolders a lot) I need a script for Adobe Bridge to take all the way from the image, separated from individual files paths file and store these records in the form of keywords separated in the metadata of the image.

For example, I have the image.jpg/Work/Job01/share/Photos and image B.jpg file in the folder/Work/Job02/PartB/Photos. After I run the script from Adobe Bridge on file/work, I want to have for the two added images keywords

Size: Work; Job01; Share; Photos

Notice: Work; Job02; PartB; Photos

As 'Work' and 'Pictures' folders are usually present, it would be nice to have the opportunity to put these two exact strings in script and exclude keywords added, but it is not necessary :-)

The bellows of script adds one keyword ~photos/Work/Job01/share/Photos, for what is necessary is to divide and make key words separated substrings. This would allow me to move pictures anywhere and still be able to filter as a group structure (as number of employment, or part name).

Please, could someone show me how to update this script? Or is there another solution that I just haven't found yet?

Thank you, Petr

// ADOBE BRIDGE SCRIPT // PUT FOLDER NAMES TO IPTC KEYWORDS
// from Paul Riggott Script, May 12, 2011 12:23 PM (in response to JSG_Alex_B)
// https://forums.adobe.com/thread/656144
#target bridge   
  if( BridgeTalk.appName == "bridge" ) {   
AddFolderNameToMeta = MenuElement.create("command", "Add folder names as keywords", "at the end of Tools"); 
} 
AddFolderNameToMeta.onSelect = function () { 
  addFolderName(); 
  } 
function addFolderName(){ 
var folders =[]; 
var Pics=0; 
folders = FindAllFolders(Folder(app.document.presentationPath), folders); 
folders.unshift(Folder(app.document.presentationPath)); 
for(var a in folders){ 
  var PictureFiles = folders[a].getFiles(/\.(jpg|jpe|jpeg|gif|eps|dng|bmp|tif|tiff|psd|rle|dib|cin|dpx|sct|pbm|flm|psb|exr|pcx|pdp|nef|dcr|dc2|erf|raf|orf|tga|mrw|mos|srf|pic|pct|pxr|pdd|pef|png|x3f|raw)$/i); 
for(var p in PictureFiles){ 
    addKeyword(PictureFiles[p]) 
    Pics++; 
    } 
} 
alert("Number of Folders Processed = "+folders.length+ " Documents Processed = "+Pics); 
function addKeyword(fileName){ 
if (ExternalObject.AdobeXMPScript == undefined)  ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript"); 
var thumb = new Thumbnail(fileName); 
// I need somehow to make substrings from path to separate individual folder subfolder names and add these as separate keywords
var folderName = decodeURI(fileName.path).replace(new RegExp(/\\/g),';'); 
  if(thumb.hasMetadata){ 
      var selectedFile = thumb.spec;   
      try{ 
      var myXmpFile = new XMPFile( selectedFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE); 
  var myXmp = myXmpFile.getXMP(); 
        var keys = getArrayItems(XMPConst.NS_DC,'subject'); 
        keys.unshift(folderName); 
        keys= ReturnUniqueSortedList(keys); 
        myXmp.deleteProperty(XMPConst.NS_DC,'subject'); 
        for(var z in keys){ 
        myXmp.appendArrayItem(XMPConst.NS_DC, "subject", keys[z], 0,XMPConst.PROP_IS_ARRAY); 
        } 
        }catch(e){} 
if (myXmpFile.canPutXMP(myXmp)) { 
        myXmpFile.putXMP(myXmp); 
        myXmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY); 
        } 
} 
function getArrayItems(ns, prop){ 
var arrItem=[]; 
var items = myXmp.countArrayItems(ns, prop); 
  for(var i = 1;i <= items;i++){ 
    arrItem.push(myXmp.getArrayItem(ns, prop, i)); 
                } 
return arrItem; 
} 
}; 
function FindAllFolders( srcFolderStr, destArray) { 
var fileFolderArray = Folder( srcFolderStr ).getFiles(); 
for ( var i = 0; i < fileFolderArray.length; i++ ) { 
  var fileFoldObj = fileFolderArray[i]; 
  if ( fileFoldObj instanceof File ) {   
  } else { 
        destArray.push( Folder(fileFoldObj) ); 
  FindAllFolders( fileFoldObj.toString(), destArray ); 
  } 
} 
return destArray; 
} 
function ReturnUniqueSortedList(ArrayName){ 
var unduped = new Object; 
for (var i = 0; i < ArrayName.length; i++) {   
unduped[ArrayName[i]] = ArrayName[i]; 
} 
var uniques = new Array;for (var k in unduped) { 
  uniques.push(unduped[k]); 
  } 
uniques.sort(); 
return uniques; 
} 
}; 

The only other option that I know uses ExifTool:

Help by adding information of path as keywords

Tags: Bridge

Similar Questions

  • How to add the Image and label in single object?

    Hai,

    I am the development and the application. I need to insert an image and a label in a horizontal list. the label is placed below the image. How by programming made in the present?

    Thank you

    Dembélé

    You will need to use converters of the cell. Just search this forum for more information, and you will find many topics, like this one for example.

  • Use the image metadata to "put in subfolder" export option?

    Hi all

    I was wondering if it is possible to put metadata (or presets or even a regular expression) in the field that appears in the export Panel when "put in the subfolder" is checked.

    I found this wonderful plugin

    http://www.Adobe.com/cfusion/exchange/index.cfm?event=extensionDetail & loc = en_US & extid = 3029 022

    that almost made the work, except for the fact that it does not accept subfolder of the current folder in option: I must still define the fullpath to the location of startup (called 'root' in the plugin), so to limit the advantage of having the destination folder that is created programmatically.

    Does anyone know a way to get exported in the subfolder images while being able to have this folder created by program name (using the metadata of image or something else, besides)?

    Thank you very much.

    Duplicate preset "Name of the Source as folder name Export folder" and name it "My folder Switcheroo" or something else, then

    change:

    local srcDir = LrPathUtils.parent (srcPath)

    local dirName = LrPathUtils.leafName (srcDir)

    local newDir = LrPathUtils.standardizePath (LrPathUtils.child (dir, dirName))

    TO:

    local srcParentDir = LrPathUtils.parent (srcPath)

    local srcParentDirName = LrPathUtils.leafName (srcParentDir)

    local srcGrandParentDir = LrPathUtils.parent (srcParentDir)

    local srcGrandParentDirName = LrPathUtils.leafName (srcGrandParentDir)

    local newDir = LrPathUtils.standardizePath (LrPathUtils.child (dir, srcParentDirName... " " .. srcGrandParentDirName)) - path of standardization is not necessary in this case, but isn't bad either.

    That's all (attention to typos...), once you have inserted the filter "Custom Naming" and "Custom file Naming" enabled, I mean.

    Rob

  • Place the image metadata

    Hello

    I would like to be able to add the name of the image file in the image. Is it possible to do it automatically in Lightroom?

    Lightroom has not built in ability to overlay on a photo file name.

    There is a plugin which can do when you export the picture. The plug-in is called Mogrify.

  • Update of the Image metadata in Image file

    Hi all

    I'm trying to update the value of image metadata such as title, subject, Description of the Image, comments, author, etc. through Java code but have failed to do.

    I tried a lot of code available online but that you have failed.

    However, I was able to read the values of metadata and print, but the writing is a problem.

    Could someone please help me with the part code writing or updating the metadata values in an Image.

    Precise scenario is - I have many images I want to compress to reduce the disk space used. But the compression code generates an image in which all the metadata (attributes of the image), the values are lost, who are important to me. So find a code by which I can copy read the metadata of the values of the original image and write it to the compressed image.

    Kind regards

    Sanket

    Hi all

    Thanks for your help and support.

    However, I found a solution to my problem.

    Here is the link for the same thing:

    http://www.programcreek.com/java-api-examples/index.php?source_dir=Augendiagnose-master/AugendiagnoseIdea/augendiagnoseLib/src/main/java/de/jeisfeld/augendiagnoselib/util/imagefile/JpegMetadataUtil.java

    In this, I removed the part of code that is related to android and my task was accomplished.

    In particular, those that are not needed are under classes. Just their comment and make the appropriate changes in the code to resolve the error and everything works fine.

    Import android.media.ExifInterface;

    Import android.util.Log;

    Import de.jeisfeld.augendiagnoselib.Application;

    Import de.jeisfeld.augendiagnoselib.R;

    Import de.jeisfeld.augendiagnoselib.util.PreferenceUtil;

    Kind regards

    Sanket

  • Improvement of the feature: set the timing of mouse separated from slide

    We need the ability to adjust the timing of mouse separately by the timing. For example: I want to have the visible slide for 15 seconds. I want the mouse appear immediately (when the slide appears 0.0 seconds). So, I want the mouse to 'travel' to about 2.5 seconds. However, when I save the file and look at the slide, Captivate allows you to set the mouse appear 0.0 seconds after the slide appears, but now the mouse takes 15 seconds to 'trip '. When the distance between objects on the screen is light, the mouse movement is almost imperceptible.

    Thanks, DBlake

    Unfortunately, the function of the chronology and the functionality of the properties for the mouse seem to work differently. I continued to change the properties of the mouse and setting the properties of the slide. Then when I went to another slide and came back, I noticed that Captivate automatically changed the properties of the mouse in order to integrate the length of time of the slide. However, using the method of drag timeline seems to solve the problem. I am happy to know that we can solve the problem, but I think we can have a bug on our hands.

    I'll be passing the method timeline along as the solution for our team. Thank you for all your help. -DBlake

  • An error occurred when trying to share &#60; folder name &#62;. There is no end point for more available from the endpoint mapper. The shared resource was not created at this time

    Original title: sharing folder error

    How to solve this error message when I am trying to share a folder: "an error has occurred when trying to share . There is no end point for more available from the endpoint mapper. The shared resource was not created at this time. »

    Hello

    Were there any changes made on the computer before the show?

    I suggest to see the link and try to run the Troubleshooter:

    Share files with anyone

    http://Windows.Microsoft.com/en-us/Windows7/share-files-with-someone

    See also:

    File sharing essentials

    http://Windows.Microsoft.com/en-us/Windows7/file-sharing-essentials

  • Add the template to measure continuously from its acquisition

    Hi all

    I use the example of the continuous measurement as a basis to work from.

    I want to measure the noise of a microphone that is connected to the laptop via a usb device and measure signals from a data acquisition device too.

    My problem is that I have included an another loop.vi message of goodwill (which is for the microphone recording) in the main.vi however, whenever I have change the acquisition for the microphone, it affects the message loop.vi for the DAQ hardware acquisition.

    In addition, because I added an acquisition additional message loop.vi, how can I connect the events to include the acquisition of micro?

    Hey Hammertimer,

    Sorry for the late reply, this maybe isn't a problem for you more.

    I think you see the problem mainly to the behavior of FIFO queues. The enqueue function will dequeue only in one rather than two of them dequeue function and will not particularly explicit regarding which of the dequeue function removes the item to (almost random fact micro loop or loop DAQ), leading to undesirable effects, I guess.

    (1) you could change only acquisition loop, so that when you press start, the case of departure contained the information to start recording microphone and DAQ hardware loop acquisition, rather than having a for each loop.

    (2) If you want to control either individually, you can edit all messages queues 'create' to add additional lines (other than the acquisition, logging and UI) for example, the queue of the 'acquisition of MIC' and then in your acquisition of micro loop, ungroup this instance of queue instead of the standardized for you queue instance give a separate control on the acquisition of MIC.

    Option (1) is more appropriate if you want to trigger a single button
    Option (2) is more appropriate if you want to the different buttons to trigger recording microphone or acquisition DAQ.

    I hope that I have which explains clearly and satisfy your question about scale to the top of your message queue manager waiting!

  • How can I add the meta tag keywords in MUSE

    I was wondering if I can add keywords in the tag meta for SEO?

    You can. Go to properties of the Page under the menu on the Page. Click the metadata tab in the dialog box.

    David

    http://creativemuse.co

  • Most of the icons in my toolbar bookmarks disappeared when I imported to a new computer. How can I restore or manually add the images?

    By selecting 'Use small icons' in the window customize the toolbar is not the problem

    You can try to delete these bookmarks and recreate them to see if that helps.
    .

  • The letter 'a' becomes separated from its associated Word and is placed on a line separate from his own. For example, I opened my Firefox home page and ther I my BT mail alerts. It spreads as described previously. All comments patches?

    See above question

    I think I found the problem. There is an additional toolbar, my son had downloaded. I uninstalled it and the problems... I think so

  • How to replace the complex paths with an image?

    I try to add the image of the "CINCO CrossFit" logo on the surfboard of the user divided horizontally.



    What is the best way to do it? BTW - I have the complete eps file, but I didn't block the forum with such a huge file.

    20607830-Diversity-colors-transparent-bands-surfer-with-surfboard-over-grunge-background-This-illustration-co-Stock-Vector.jpg

    Cinco CrossFit beach logo.jpg

    Thanks in advance for your help.

    rcinco,

    Kurt is sometimes abrupt (like me).

    You can select all the paths of the surfboard surf/surf/whatever, then object > compound path > make and use the path composed as the Clipping Path of Object > clipping mask > make.

    But you may need to make a few changes to avoid the holes where they overlap.

    You could also (working on a copy as it should (almost) always, especially when the destructive works):

    (1) move/create a copy of the desired work and just group them, and then set the background color of this in white;

    (2) place you like on top of the image, select both, and in transparency, click Launcher palette make the opacity with ticked Clip mask and invert the mask unchecked.

  • How to add the phase parameter to array of waveform in the DaQmx continuous output example?

    Hi all

    I'm quite beginning to Labview. I just wanted to know how can I add stage information for the module of waveform existing as shown in the example of output Voltage-Continuous DaQmx.

    SEEE attached, I thought that the "output" is actually a built-in control, is there anyway I can add the phase as an additional parameter which?

    Thanks in advance for any help.

    Eric

    If you press ctrl + H, the context help window opens, and you can hover over the generating function VI to see its inputs/outputs, but also to navigate to the detailed help. As you can see from this screenshot, there is an exit for the phase which is separated from the output waveform.

  • Add the 2 containers

    How can I add the same images to 2 sprites?
    The code below does not give an error but only adds the image to 1 sprite

    Canvas1 = new Sprite();
    Canvas2 = new Sprite();


    public void ClassPlayer (ccanvas1:Sprite, ccanvas2:Sprite, sheight:int) {}
    ...
    Canvas2. AddChild (img1);
    Canvas1. AddChild (img1);

    in other words, you expect of duplication that does not happen. There is no good way to create a copy of the instance in AS3 (unlike in AS2). You must create another totally independent instance.

  • Configuration of the image in OBIEE 11 g

    Hello

    I am aware of the image configuration in OBIEE 10 g. Now, I want to be implemented in OBIEE 11 g, where I want to add the image. What service I want to restart?

    Thank you
    Sirjacobs

    View the Images path obiee 11 g

Maybe you are looking for

  • Software update gets stuck to connect to the update server

    For a very long time (since Firefox 4 or more), I'm notified of updates, but when I say update I just get a window that says it has download firefox and it connects to the update server and it stays there forever. I left open for days and it never go

  • Display drivers crashing when connecting Skype with a new monitor BenQ

    Hello, so I just got a new BenQ XL2411Z monitor and for some reason, when I connect on Skype, display drivers crash 9/10 times. If I use the old monitor and launch Skype everything works normally, but display runnning drivers the new BenQ it will cra

  • Adding other repairs to a service order

    Hello I know that this is not the right place for it, but I don't know where to put this. There is no general 'customer support' support forum. Recently, I put in a repair order for my laptop (HP Pavilion g7 - 2217cl) because the right hinge broke. T

  • A comparison to run using a structure case

    Hello I'm writing a simple program, but I can't seem to understand how to write it. I have a dynamic series of data (about 16 000 values) running inside a while loop. I want to add 180 a value if that value is less than 30. My idea was to: 1 make a c

  • How can I burn a Windows XP I received my account of MSDNAA on a CD to make it Bootable?

    I downloaded an installer of Windows XP from my MSDNAA account, and I want to burn it to a CD to make an installation program. I forgot how do, and I want to ask again how will do? I mean, I do just burn the content of the. Archive RAR I got, or shou