Attaching GPSBabel operations to a single mouse click
Robert Nixon offers this tip for OS/X users to associate GPSBabel commands with a single click.The following is an applescript that will allow you to click once and convert a file using gpsbabel without using the command line. What is better is that you can add more functionality and convert more than one file by just redefining the variables after the "do shell script" command and adding another "do shell script" command.
The script editor application is in /Applications/Utilities/
Open "Script Editor" and put the following in a new script file.
--start script
tell application "system events"
activate
-- user variables
--HINT a '~/' is your home folder
set inputTYPE to "gpx" --set the input file type
set outputTYPE to "mapsend" --set the output file type
set inputPATH to "~/Desktop/yourfile.gpx" --set the path to where your input file is
set outputPATH to "~/Desktop/yournewfile.wpt" --set the path to where your output file will be
--the meat and potatoes, aka that part that gets it done
do shell script "/path/to/your/gpsbabel -i " & inputTYPE & " -f
" & inputPATH & " -o " & outputTYPE & " -F " & outputPATH
end tell
--end script
Save the file as an application and you can put it in the dock to
do a one click conversion over and over, any time you want to
convert a or upload specific file.
Substitute 'gpx' and 'mapsend' for the type of file and the name of the files involved to taste, of course.