Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 158 lines (158 sloc) 6.76 KB
.Dd 1/11/05
.Dt platypus 1
.Os Darwin
.Nm platypus
.Nd create Mac OS X application wrapper around a script.
.Op Fl vh
.Op Fl P Ar profile
.Op Fl a Ar appName
.Op Fl c Ar scriptPath
.Op Fl o Ar outputType
.Op Fl i Ar icon
.Op Fl p Ar interpreter
.Op Fl V Ar version
.Op Fl s Ar signature
.Op Fl I Ar identifier
.Op Fl f Ar bundledFile
.Op Fl X Ar suffixes
.Op Fl T Ar filetypes
.Op Fl N Ar environment
.Op Fl G Ar arguments
is the command line counterpart of the Platypus Mac OS X application. It is a command line too
that creates Mac OS X application bundles that in turn execute a script.
supports the following flags (executed in the order which they are passed):
.Bl -tag -width -Fl
.It Fl p Ar [profile]
Loads all settings from a profile file generated by the Mac OS X application. You will
still need to specify a destination path for the application.
.It Fl a Ar [appName]
Specifies the name of the application to be created. This is can be different from the name of the .app
bundle itself, and is displayed in the application's menus, about window and Info.plist property list.
.It Fl c Ar [scriptPath]
Path to the script that is to be wrapped into an application.
.It Fl o Ar [outputType]
Specifies the script application's output type.
Four different kinds of (case sensitive) values are supported as arguments:
.Ar 'None'
The application has no graphical output. Script text output goes to STDOUT.
.Ar 'Progress Bar'
The application displays an indeterminate progress bar. Script output goes to STDOUT.
.Ar 'Text Window'
The application displays a window with a text field which receives all script output.
.Ar 'Web'
The application displays a window with a web view which renders output as HTML.
.It Fl i Ar [icon]
Specifies a file to use as icon for the application bundle.
The icon file can be a regular Mac OS X .icns file, or an image file of any kind
supported by the Mac OS X Cocoa APIs. As of writing, this includes JPEG, GIF, PNG,
TIFF, PSD, BMP, PICT, TGA, SGI, PNTG PDF, EPS and PostScript (.ps). The image will
be scaled to 128x128 pixel size, which is standard for Mac OS X icons.
.It Fl p Ar [interpreter]
Sets the interpreter for your script (e.g. /usr/bin/perl). If no interpreter is specified, the default is the default shell (/bin/sh).
.It Fl V Ar [version]
Sets the application bundle's version. This is reflected in the application bundle's Info.plist
property list and About window.
.It Fl u Ar [author]
Sets the name of the application author (e.g. "Apple Computer" or "John Smith"). If not specified, platypus will default to the current user's full user name.
.It Fl s Ar [signature]
Mostly for backwards compatibility and heritage reasons. In Mac OS 9 and earlier (and, indeed, in
Mac OS X), each application was assigned a four character ASCII signature known as an OSType. It
is possible to register application signatures in a database on the Apple Developer Website.
Please note that Apple has reserved all lowercase-only combinations.
Chances are that you will have no need of this option.
If it is left empty, the application will get the signature string '????', which is ignored
by Mac OS X. This value is stored within the application bundle in the Info.plist application
propertly list.
.It Fl f Ar [bundledFile]
Specifies a file to be bundled with the script application. This file will be copied over the Resources
folder of the application bundle, which is the same folder in which your script will eventually reside. You
can specify any number of files to be bundled, but you must use the -f flag each time, since
the flag only accepts one file path after the -f flag.
.It Fl I Ar [identifier]
Sets the application's bundle identifier. An application identifier is a kind of reverse DNS name
(e.g. If this option is left empty,
will default to an identifier of the format "org.username.appname" (e.g. org.sveinbjornt.Platypus).
.It Fl F
If set, your script will receive the path to the application (e.g. "/Applications/") as the first argument ($ARGV[1], $1 etc., depending on your scripting language of choice).
.It Fl A
This flag makes the application request Administrator privileges via Apple's Security Framework (i.e.
prompt for a password) and then execute the script with those privileges.
.It Fl S
Secure bundled script. This encrypts the bundled script, to fend off prying eyes.
Please note that this will NOT make the script inaccessible to an
experienced hacker, but just might serve to dissuade the less determined.
.It Fl D
Makes your script application "droppable", i.e. capable of receiving drag'n dropped files as arguments
to the script. The application bundle's property list is modified so
that it can receive dropped files in the Dock and Finder.
These files are then passed on to the script as arguments via @ARGV.
.It Fl B
This option causes the application to run in the background. The application will not appear in the Dock or bring
its windows to the front when launched. This is achieved by registering the application with the Finder
as a user interface element (LSUIElement).
.It Fl R
This option sets the application so that it remains running after the script has been executed. It can then later be quit by the user via regular means (i.e. Quit menu item).
.It Fl X Ar [suffixes]
Only appropriate if you are using the -D option. This flag allows you to specify the file suffixes
(e.g. .txt, .wav) your application can open. This should be a |-separated string (e.g. "txt|wav|jpg").
.It Fl T Ar [filetypes]
Only appropriate if you are using the -D option. This flag allows you to specify the file type codes (e.g. '8BIM', 'TEXT') your application can open. This should be a |-separated string of 4-character ASCII strings (e.g. "8BIM|TEXT|R*ch").
.It Fl G Ar [arguments]
Arguments for the script interpreter. These should be specified as a |-separated string (e.g. '-w|-s|-l').
.It Fl N Ar [environemnt]
Sets environmental variables for your script. These should be specified as a |-separated string of name=value pairs (e.g. 'EDITOR=pico|TERM=xterm-color').
.It Fl v
Prints the version of the platypus command line utility
.It Fl h
Prints help and usage string
utility exits 0 on success, and >0 if an error occurs.
.Bl -tag -width "//usr/local/share/platypus/PlatypusDefault.icns" -compact
.It Pa /usr/local/bin/platypus
program binary
.It Pa /usr/local/share/platypus/ScriptExec
executable for script app
.It Pa /usr/local/share/platypus/MainMenu.nib
Nib file for script app
.It Pa /usr/local/share/platypus/PlatypusDefault.icns
Default icons
This manual page was written by
.An Sveinbjorn Thordarson Aq .
Jump to Line
Something went wrong with that request. Please try again.