Thank you very much Hayo. I must admit that although I've used Macs since 1984, and Max OS X since it came out, I have never dealved into scripting in Unix.
As long as you dare type a few commands in the Terminal, you should be able to use the method I described. If necessary I can detail this step by step for you, just let me know :-)
One key to your first method is that components of the filename should be found in some variable or another. For me unfortunately this is not the case, but maybe it is a lesson for the future!
In my workflow and file naming I simply name the file using the sortable versions of the date and time sorted (up to the miliseconds if encoded in the file. An abbreviation of the camera model used is added to cover those cases where there are two shots by different cameras shot at exactly the same time (I've had this happen). This filename has the advantage that when sorting on filename, the images appear in order, and each filename is unique and totally reproducible from the content of the file.
Admittedly, the filename this way is quite long and also non descriptive. Here comes the power of PM though, it's ability to show labels underneath each file (here I show e.g., the caption) gives me all the information I need.
Anyway, what I do really isn't important. What is important is you settle on a naming scheme you like
If search and replace in filenames is just not possible for some reason in PM, then a useful addition to PM would be Functions that could act on variables. In a sense we already have the Substring function in the substring extraction but what about adding more functions like:
1. Length{variable} which would return the length of the string
You may not need this one as you can already offset from the end of a certain string
2. Position{variable,"string"] which would return the position or number of characters from the left of the starting position of "String" in Variable. Then you could use the value of Position to hash into a string.
3. etc
Things like this could indeed be useful. With all the work on the cataloguing feature, however, this one might not get implemented anytime soon (if at all).
Hmm, now I'm thinking about it, your problem could be solved on the command-line much simpler. Simply run the following command in a directory where you have files you need the _IMG part removed off:
for a in *_IMG*; do mv "$a" "${a//_IMG/}"; doneThis command will go over all files with _IMG in their name, and rename (mv) them, stripping the _IMG bit. On the filenames you gave as an example this works flawlessly, but if you want to test before you change the filenames, all you need to do is change the mv in above line to echo; this will then just list both the original name as well as the new name (i.e., without the _IMG part).
Hope this solves it for you,
Hayo