Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by karlgoethebier (Priest)
on Jan 21, 2013 at 09:41 UTC ( #1014416=note: print w/ replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1014416]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2014-12-29 07:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (185 votes), past polls