I use the TitleCase program from the download area and I love it. I've also written a renaming button using Opus functions that will take an mp3 file from my collection and, if it starts with "The" or "A," it will put that at the end of the filename. Example: "The Ocean.mp3" becomes "Ocean, The.mp3". Now I'm trying to combine both into one button. It's not working so well.
When I select a file and click on the combined button, TitleCase is supposed to run first, then the renamer is supposed to run. The problem is that TitleCase is not being given a chance to actually be called and run on a file before the renamer kicks in. Example: running the combined button on "The Song Remains The Same.mp3" results in "Song Remains The Same, The.mp3" and an error message from TitleCase because the filename that got passed as the argument no longer exists (because the renamer has already changed it). Running the combined button on a file that doesn't start with "The" or "A," and thus wouldn't be changed by the renamer, produces the correct result.
Is there a way to insert a pause into the button's code, which will allow TitleCase enough time to run to completion, and then continue with the renamer? I'd really like to combine both funtions into one action. Any ideas?
Here's how the button is currently set up:
<?xml version="1.0"?> Music Rename Places "The" and "A" at the end 154 Rename PATTERN="(.*)(- [0-9][0-9] - )(The |A )(.*)\.(.*)" TO "\1\2\4, \3.\5" REGEXP @NODESELECT Rename PATTERN="(.*)(\ \.)(.*)" TO "\1.\3" REGEXP--chriscrutch