Thanks. PilotError's method was straightforward and successful -- no software errors, newbie errors, or even pilot errors. But it still had more steps than I used to need in Windows: switching from Terminal after unarchiving, to the desktop to use an editor (my fault, admittedly, for not knowing the unix editor(s) which I assume Terminal has access to), then back to Terminal to rearchive -- plus the more keystrokes needed for the unix commands. I'd still like to find an editor which does it *all* inside one program, like IZArc did in Windows: ctrl-open, edit, ctrl-close -- zip-zip (pun intended)!
I don't know of any tool that does everything. Frankly, this is the first time I've ever seen anyone ask how to edit a file within a jar on Mac OS, so I'm guessing there isn't a big target market.
You can paste command-lines into Terminal, so just save the commands into a text file, then copy and paste away. No typing needed.
Here's roughly what I would save in the text file:
Code:
jar -xvf jarfile.jar ## Extracts the files
open -e path/to/fileYouWantToEdit.itsExtension
jar -cvf jarfile.jar ## Create the new Jar file
You should obviously change the jarfile.jar to the actual jar file you have.
I've shown ## because those are the actual comment character for bash.
I've also shown an 'open -e' command with a pathname you will have to substitute. The open -e will open the named file in TextEdit.app. If you have another editor you prefer instead, you can tell 'open' to use it instead. Here's the man page for the 'open' command:
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/open.1.html
Look at the -a and -b options in particular.
Finally, you can put other commands in there, such as a 'cd someDir' or whatever else you want.
You could probably write a 'sed' script to do the replacement, so you wouldn't have to manually edit the file at all. Then you could make the whole thing into a shell script, wrap that into an AppleScript and save it as a droplet. Then in future, you simply drop your original app onto the AppleScript droplet and it would do all the changes automatically. You'd have to write and debug all that stuff, though, and it would probably take hours more time than just doing a copy/paste when the app gets updated.
If the change to the jar is something the vendor should provide, you should probably file a bug-report against the app. Because the cleanest fix is to not have to fix it yourself at all.