tell application "Finder" set thisFile to (choose file with prompt "Pick the file to convert:") set outfile to choose file name with prompt "Where shall I save this stuff?" end tell gogogo(thisFile, outfile) on gogogo(thisFile, outfile) set unixy_thisFile to (POSIX path of thisFile) set unixy_outFile to (POSIX path of outfile) set thisscriptpath to (path to me as string) set oldDelims to AppleScript's text item delimiters set AppleScript's text item delimiters to {":"} set scriptname to last text item of thisscriptpath set the perlscriptpath to replace_chars(thisscriptpath, scriptname, "") set AppleScript's text item delimiters to oldDelims set unixy_perlscriptpath to (POSIX path of perlscriptpath) do shell script "/usr/bin/perl " & unixy_perlscriptpath & "program.pl " & unixy_thisFile & ":" & unixy_outFile & "" display dialog "Finished Converting. New file at " & outfile & "" buttons {"Thanks"} with icon caution giving up after 4 end gogogo on replace_chars(this_text, search_string, replacement_string) set AppleScript's text item delimiters to the search_string set the item_list to every text item of this_text set AppleScript's text item delimiters to the replacement_string set this_text to the item_list as string set AppleScript's text item delimiters to "" return this_text end replace_chars on open what set thisFile to what set outfile to choose file name with prompt "Where shall I save this stuff?" gogogo(thisFile, outfile) end open