Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

madsylar

macrumors member
Original poster
May 5, 2010
58
13
Hi.

On Windows, you can right click a file and choose either "Extract to" -> and choose where, or "Extract to FileNameAsDirectory".

On the Mac, using stuffit or pathfinder, every time that I open a zip or rar file it extracts to the directory without any question.

How can I get those items on the context menu ? I'd like to have both,
1) Extract to -> and choose
2) Extract to Filename (ie, if file is trip_images.zip, i can choose to extract to trip_images new directory).

Please check attachment.

Thank you
 

Attachments

  • windows.png
    windows.png
    25.2 KB · Views: 497
Technically that was added to Windows with 3rd party software. WinRAR I believe.

There are a number of 3rd party unzip tools, for Mac OS, that probably add those items to contextual menus.

You can also accomplish this with Services. While there are no built in Extraction tools in Automator, this can be done pretty easily with Applescript.

Code:
on run {input, parameters}
	
	repeat with i from 1 to count input
		set inputFile to quoted form of POSIX path of input's item i
		set destFolder to quoted form of POSIX path of (choose folder with prompt "Choose the folder you wish to extract to...")
		do shell script "unzip " & inputFile & " -d " & destFolder
	end repeat
end run

This is a very basic script and assumes very little about what you want. However, it does work and allows you to select multiple zips and define different locations for each.

To use it:

1. Open Automator
2. Select the "Service" template.
3. At the top, Select, Services receives selected: "files and folders" in "Finder"
4. Drag the "Run Applescript" action into the workflow
5. Copy and paste the script above into the Run Applescript action
6. Save the workflow, give it a name like "Extract to..."
7. Now, right click on a zip file, go down to Services and select the action

Some notes:
1. This will appear for any file or folder not just zips.
2. In its current form, it does not tell you which file you are choosing to extract. Since it is something I just threw together, I didn't add many features, just the basic structure.
 
This post deserved a thank you. So I just registered and now my evening can be complete: thank you for you help !
 
Hi calderone,

I was the original poster and didn't even say thank you. I forgot to check the subscription option to receive emails with replies and just assumed this wasn't replied at all.

Many thanks for your help and sorry everyone to resurrect a thread from 2010.

Also thanks Fuzati for the reminder.

Cheers,

leo
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.