set theWindowTitle to "PerlMonks" set theOption to text returned of (display dialog "Enter a Source folder:" & return default answer "" with title theWindowTitle) set thePerlScript to quoted form of (POSIX path of ((choose file with prompt "Select a script:") as Unicode text)) set theResult to do shell script thePerlScript & " -S " & theOption display dialog "Result: " & theResult with title theWindowTitle