Updated script to take a 3rd parameter which appends ~iphone or ~ipad to the output files