file types using bash unzip

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

file types using bash unzip Sat Aug 13, 2016 12:07 pm • by dotsandlines
I'm trying to make a workflow that automatically extracts image files out of .docx files, which are essentially .zip files. I've almost got it working... But I find that in Hazel, my script will only extract file extensions .png and .jpeg, and won't do .jpg (or, as I discovered while troubleshooting, .xml). Unzip grabs all file types when run through Terminal.

FILENAME="$1"
MYPATH=$(dirname "$FILENAME")
unzip -j "$1" *{.png,.jpeg,.jpg} -d "$MYPATH"

Fallback is to try an external shell script, but I thought I'd ask here first.
dotsandlines
 
Posts: 1
Joined: Sat Aug 13, 2016 11:04 am

Re: file types using bash unzip Mon Aug 15, 2016 11:12 am • by Mr_Noodle
Turn on debug mode (see sticky article) which will show any output from the script. If there are no errors showing there you may need to add output statements to your script.
Mr_Noodle
Site Admin
 
Posts: 11879
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron