/*************************************************************************************************** * PhotoGrok Script * * Make sure folder locations (or catalog) contains both * jpeg and raw images. * * Populate the 'raws' variable below with the ExifTool * raw file types you're interested in. * * Build the tree. After the first tree of all jpegs is built, * a second tree will be built containing the raw files * that do not have a corresponding jpeg. * * This assumes processed jpegs will have the same DateTimeOriginal * and Model values as the raw files. * * Requires the following filter to be set on the filter screen * (always the last filter if multiple filters defined): * * Model,DateTimeOriginal | Javascript Expression | match(Model,DateTimeOriginal) * * Script fails with Apple's JVM 6 because the javascript interpreter does not support * indexOf() method used in the match function. **************************************************************************************************/ // change this variable to suite your needs var raws = 'rw2,orf,arw'; var init = false; function onBuildTree(cat){ init = !getMap().containsKey('jpegs'); if(init){ setExtensions('jpg'); getMap().put('jpegs', new Array()); }else{ setExtensions(raws); } } function match(model, dt){ var ret = false; var a = getMap().get('jpegs'); if(init){ a[a.length] = model + '|' + dt; ret = true; }else{ ret = a.indexOf(model + '|' + dt) == -1; } return ret; } // cycle tree build between jpeg and raw function done(){ if(!init){ getMap().clear(); }else{ buildTree(true, z); } } function z(){ showMessage("Done!"); }