It happens quite regularly that I need to extract a JAR or WAR file for a brief inspection. Of course I can do it on command line however, when operating in Finder I wanted to get something that just unarchives a selected file by mouse click.
To achieve this I used for the very first time Automator, a tool I didn’t really think would be providing a solution to any of my needs. What I did do:
- Open Automator
- New > Service
- In the drop down menus choose in Service receives selected files or folders in Finder.app
- In Actions search for Run Shell Script and double click on it
- enter this as command line unzip -n “$1″ -d “$1″.zip
- select for Pass input as arguments
- Click on Save and give a name, e.g. Extract Archive
- Open Finder
- Right click any archive
- In the context menu select Services > Extract Archive
Note: As a filetype cannot be selected the menu is available for all files and folders. If you select something that is not a extractable with unzip you’ll see an error message.
Popularity: 4% [?]Tags: finder, how-to, java, mac, unzip