Apple Script for automatically changing time codes in a text document
Hi, I have a bunch of what are called LRC files that I need to fix and would love to be able to do it automatically. LRC files are text files with time codes and lyrics and are named "songtitle.lrc". So for example the LRC for the song Happy would be called "Happy.lrc" and if you open it up with a text editor it looks like this:
[ti:HAPPY]
[ar:PHARRELL WILLIAMS]
[la:en]
[00:20.08]<00:21.08>IT MIGHT SEEM CRAZY
[00:22.41]<00:22.41>WHAT IM ABOUT TO SAY
[00:26.93]<00:26.93>SUNSHINE SHES HERE
[00:28.37]<00:28.37>YOU CAN TAKE A BREAK
[00:32.16]<00:32.16>IM A HOT AIR BALLOON
and this continues for the whole song, but I think you get the idea. What I need to do is change all of the time codes by the same amount. Specifically I want to be able to subtract a certain amount of time from every line in the lrc file. So somewhere in the script I could designate the amount of seconds I'd like to subtract and then the script would take the lrc file and subtract that amount of time from every line. For example if I entered 8 seconds and pointed it to the lrc file for the song happy it would output:
[ti:HAPPY]
[ar:PHARRELL WILLIAMS]
[la:en]
[00:12.08]<00:13.08>IT MIGHT SEEM CRAZY
[00:14.41]<00:14.41>WHAT IM ABOUT TO SAY
[00:18.93]<00:18.93>SUNSHINE SHES HERE
[00:20.37]<00:20.37>YOU CAN TAKE A BREAK
[00:24.16]<00:24.16>IM A HOT AIR BALLOON
and so on. Unfortunately I don't know any Apple Script so I wouldn't know where to begin. So my question is: is this script feasible? easy? If it is feasible I'd appreciate any help with figuring out how to write it. If you know any of the commands that I will need to utilize please let me know. Or if you can help me write the script or parts of it, that would be amazing. Also if AppleScript can only manipulate text documents in this manner, I can easily paste the lrc file into a text document and use that for editing and then turn it back into an lrc file.
Thank you for your help
MacBook Pro, Mac OS X (10.7.5), null