http://www.perlmonks.org?node_id=1014416


in reply to Re^2: How to create GUI for a perl script on MAC?/Apple Script and Perl?
in thread How to create GUI for a perl script on MAC?/Apple Script and Perl?

This snippet reads a option, does the backgrounding and reads the pid of the current perlscript for killing it...

set theWindowTitle to "PerlMonks" set theOption to text returned of (display dialog "Enter a sourceFolde +r:" & 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 cmd to thePerlscript & " -S " & theOption & " &> /dev/null" & " & + echo $!" display dialog "Command: " & cmd with title theWindowTitle do shell script cmd set pid to the result display dialog "PID: " & pid with title theWindowTitle display dialog "Kill the proccess (" & pid & ")" buttons {"OK"} with t +itle theWindowTitle do shell script ("kill " & pid)

I hope this helps a little bit to work it out...

Best regards, Karl

«The Crux of the Biscuit is the Apostrophe»

  • Comment on Re^3: How to create GUI for a perl script on MAC?/Apple Script and Perl?
  • Download Code