2

This may be a basic question. I have written a small perl script to run on a Mac running OS X which can be called from the finder by double clicking in the normal way. The file is executable and contains starts with #!/usr/bin/perl and input and output is via the clipboard. This all works but automatically opens a terminal window which the user must then close once execution is finished.

Is there an easy way to run this program as an application without opening a terminal? Can one do this with the native OS X perl? Or do I need to download something? Since the program will also be used by other users, the simpler the solution to better.

3 Answers 3

3

With the application "AppleScript Editor" : open it

Copy/paste this script

tell me to path to resource "this Name.pl" in directory "Scripts"
do shell script (quoted form of POSIX path of the result)

In the first line, change the name "this Name.pl" by the name of your perl file.

Save as --> Application

In the Finder : Copy your perl file (executable) to the folder "/Contents/Resources/Scripts" of the created application

1
  • Getting 'error "A resource wasn’t found." number -192'. Are there additional parameters?
    – Jozef Xie
    Nov 20, 2021 at 7:27
0

For Win32/Linux/or Mac use http://www.cavapackager.com/

0

If you're distributing your application to others, Platypus includes an installer to build free-standing apps around scripts.

Platypus supports Perl, Python, PHP, Ruby, Swift, Expect, Tcl, AppleScript or any other user-specified interpreter. It is free, open-source software distributed under the terms of the three-clause BSD license. It can run silently (without opening a terminal window, as you require), or can display graphical feedback of script execution as progress bar, text window with script output, droplet, WebKit HTML rendering or status item menu.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.