After writing this hint about testing .zip archives with Automator, I realized I could create a similar workflow to view the contents of an archive without having to decompress it.
This workflow creates a list of files contained within a .zip archive (along with file size in bytes and modification date and time). It then saves the list to a text file and opens the file for viewing. It also filters out the files contained within an invisible __MACOSX directory (including all the files with a ._ at the beginning), as they clutter the list and I am not interested in those items.
To create the workflow, open Automator and add the following actions, in the order shown:
- Finder Library -> Get Selected Finder Items.
- Automator Library -> Run Shell Script. Set the 'Shell' pop-up to /bin/bash, the 'Pass Input' pop-up to as arguments, and the actual command to unzip -l "$@". The -l flag tells unzip to list the contents of the archive without actually decompressing it.
- TextEdit Library -> Filter Paragraphs. Set the 'Return paragraphs that' pop-up to do not contain, and enter __MACOSX in the text box. (This step is optional; it will remove the invisible ._ files from your list.)
- TextEdit Library -> New Text File. I set 'Save as' to Temp Archive List.txt and 'Where' to Desktop. Alternatively, you could select 'Show Action When Run' under 'Options' to specify the file name and/or location when the workflow runs.
- Finder Library -> Open Finder Items. Leave the 'Open with' pop-up set to Default Application, or set it to your preferred text editor.
One thing to note: If you have filtered out the files in the __MACOSX directory, as I describe, the number of files listed will differ from the total given at the bottom of the list.

