Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the '10.4: List contents of .zip archives with Automator' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: List contents of .zip archives with Automator
Authored by: nicksay on Aug 03, '06 11:55:20AM
This workflow can be condensed, if you like, by using a shell script to do the task. Follow steps 1 and 2, but for step 2, use the following code for the command:
for f in "$@"; do if [[ $f == *.zip ]]; then
    a=$(unzip -l "$f" | fgrep -v __MACOSX)
    n=$(echo "$a" | wc -l)
    echo "$a" | head -n $(( n - 2 )) | open -f
fi; done
That will filter out the ._ files from the list (and remove the inaccurate file count from the bottom. If you want the ._ files in the list, use the following instead:
for f in "$@"; do
    [[ $f == *.zip ]] && unzip -l "$f" | open -f
You do not need the remaining steps of original hint.

[ Reply to This | # ]