# Firefox – Setup Firefox to save .pages as .zip automatically

conversionfirefoxfirefox-extensions

What do I want to do?

I would like Firefox to save files with the .pages extension as .zip files automatically.

# Scenario

You are browsing through your emails and you notice your friend just sent you an email with a file attached (a .pages in this example). Unfortunately, you have a laptop that runs Windows. Your friend continues to send tons of emails with .pages files attached and you are tired of manually saving the files as a .zip file.

Ultimately, you would like Firefox to be set up so that the download/file manager recognizes the .pages extension and automatically converts it to a .zip file.

What have I done?

I have saved files manually by selecting save as "All Files" and setting the extension to .zip. I've gone through Firefox and their documentation and have not found anything on how to complete this task.

Why am I doing this?

1. To save time (only a few seconds, not the main reason).
2. I would like to setup a simple solution that "converts" a file automatically without having to recall steps on how to achieve the task manually (for clients who aren't exactly tech savvy).
3. So that clients with Windows can access the files.

IMPORTANT NOTE:

I am not trying to save the web page, rather an Apple document equivalent to Microsoft Word.

UPDATE:

The really easy method would be to save one file, right click it, choose properties and open all .pages files up with WinRAR (or any other program that extracts files from a compressed folder). For the sake of learning, I am going to "neglect" this method and continue to do some research on Firefox add-ons. I would still like to have Firefox or the download manager to do the bulk of the work for converting the file.

One way to do so would be to have an external script do the conversion and have Firefox call the script. For example, the following batch script:

@echo off

:loop

if ^<%1^>==^<^> goto :eof

if not exist "%~dpnx1" (
echo "%~dpnx1" does not exist!
shift
goto :loop
)

if ^<%~x1^>==^<.pages^> (
ren "%~dpnx1" "%~n1.zip"
start "" "%~dpn1.zip"
) else (
echo "%~dpnx1" does not have the .pages extension
)

shift
goto :loop


If you set that as the Open With action inside Firefox, it will rename any .pages file to .zip and open it using the default .zip handler.

This is especially useful if Windows Explorer is your default ZIP handler, or some other program that cares about extensions - a few compression programs will happily open ZIP files no matter their extension, in which case you may as well follow @Synetech's suggestion and set that as the default handler.

Another way is with a renaming mask. It's definitely possible to set one that only activates for a certain extension (i.e. .pages), but I haven't found a way short of writing a custom plugin/addon yet. You can, however, set a global (within DTA) renaming mask in DownThemAll:

This will apply to any extension/DTA download, so it's only effective if you only use DTA for .pages files.

The first time, download with DownThemAll! and set the renaming mask and destination. Se second time, use dTa OneClick! and set it as the default action.