Get your own customer support community
 

Shell Scripts to Export Multiple Mockups

Hi there, I just wrote a shell script (in OS X) that goes through the current directory and all of its children and exports any bmml file it finds to png, placing the png next to the original bmml file.

Here's the script:

#!/bin/bash

mockupsApp="/Volumes/Macintosh HD/Applications/Balsamiq Mockups.app/Contents/MacOS/Balsamiq Mockups";

cdir=`pwd`;
for f in `find . -name "*.bmml" | awk '{gsub(/ /,"%20");print}'`;
do
infile=`echo ${cdir}/${f} | awk '{gsub(/%20/, "\ ");print}'`;
outfile=`echo $infile | awk '{sub(/bmml/,"png");print}'`;
echo "Converting $infile to $outfile";
`"$mockupsApp" export "$infile" "$outfile"`;
done

I wanted to post it here so that if someone who's better at shell scripting than me wanted to improve it, we'd have a place to do it. Also, if you have created similar scripts for Win or Linux and are willing to share, paste them here!

Thanks,
Peldi
 
happy I’m happy

Follow this discussion to get notifications on your dashboard.


User_default_medium