Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

by karlgoethebier (Vicar)
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 having an uproarious good time at the Monastery: (5)
As of 2015-07-06 05:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls