andymees@aje​ No worries! Thanks for the help, regardless! e.d. wrote Oh you're referring to Line#188, I was thinking in terms of Line#835, and to modify/combine this with the former. Should be doable. Oh, I missed that one. That is definitely a more thorough approach. That said, is it just me or is that thing buggy? Two points: The first recursive call starts looking at bins in the next layer at a position based on the parent layers' index?? Why are we checking against the next child in the list​ manually? Isn't that what would happen automatically by simply falling through to the next iteration of the loop? I mean, shouldn't that entire function look like this: searchBinForProjItemByName : function(i, currentItem, nameToFind){ for (var j = i; j < currentItem.children.numItems; j++){ var currentChild = currentItem.children ; if (currentChild.type == ProjectItemType.BIN){ return $._PPP_.searchBinForProjItemByName(0, currentChild, nameToFind); } else if (currentChild.name == nameToFind){ return currentChild; } } } Much simpler and makes fewer checks. Bruce Bullis​? Any insight into this? Is there a reason for things to be written as they are? e.d. wrote I meant to say should you already have a (reference to a) projectItem as a result of a previous query/process/whatever, this would also give you a reference to its bin "position", right? Not necessarily, no. What if I'm looking to add an item to a bin with a special name? It might be something I've hard-coded to a location. It might also be something that the user should be able to organize as they like (although not rename as we cannot associate any special hidden metadata to a bin). In one case I know the bin path but then have to do a search anyway as the only way to drill down is to iterate over all items until you find what you're looking for. (This is likely how it would be internally anyway, but at least we all wouldn't have to code the same thing ;D)
... View more