Create native Mac applications from command line scripts.

Overview

License Language Build

Platypus

Platypus is a developer tool that creates native Mac applications from command line scripts such as shell scripts or Python, Perl, Ruby, Tcl, JavaScript and PHP programs. This is done by wrapping the script in an application bundle along with a slim app binary that runs the script.

Platypus makes it easy to share scripts and programs with people who are unfamiliar with the command line interface. Native, user-friendly applications can be created with a few clicks. It is very easy to create installers, droplets, administrative applications, login items, status menu items, launchers and automations using Platypus.

Features

  • Supports shell scripts, Python, Perl, Ruby, PHP, Swift, Expect, Tcl, AWK, JavaScript, AppleScript or any other user-specified interpreter
  • Apps can display graphical feedback of script execution as a progress bar, text window with script output, droplet, WebKit HTML rendering or status item menu
  • Apps support receiving dragged and dropped files or text snippets, which are then passed to the script as arguments
  • Apps can execute scripts with root privileges via the macOS Security Framework
  • Apps can register as handlers for URI schemes and send user notifications
  • Apps can be configured to run in the background (LSUIElement)
  • Set own application icon or select from presets
  • Set app's associated file types, identifier, version, author, etc.
  • Graphical interface for bundling support files with the script
  • Command line tool for automation and build process integration
  • "Profiles" can be used to save app configurations
  • Built-in script editor, or linking with external editor of choice
  • Extensive documentation and many built-in examples to help you get started
  • Generates slim and speedy native applications that launch and run quickly
  • Fast, responsive native app written in Objective-C/Cocoa

Install

Platypus is free, open source software and has been continuously developed and maintained for a very long time (since 2003). If you find this program useful, please make a donation.

Platypus can also be installed via Homebrew (may not be latest version):

$ brew install --cask platypus

Links

Screenshots

Platypus main window

Interfaces

Platypus lets you select one of several different user interfaces for your script.

Progress Bar Interface

Text Window Interface

Web View Interface

Status Menu Interface

Droplet Interface

Building Platypus

To build Platypus, run the following command from the repository root (requires Xcode build tools):

$ make build_unsigned

The resulting application bundle is created in the products directory.

Some notes on the code

Platypus is very old software, dating back to the early days of Mac OS X, around 2003, when I was first learning to use Objective-C and the Cocoa APIs. I made many beginner mistakes, some of which remain in the structure of the code. This software has since gone through about four dozen significant versions. It has been patched, bugfixed, streamlined to include new features and was transitioned over to modern Objective-C a few years ago. It's not how I would write it today.

With these caveats in mind, here is the BSD-licensed source code to Platypus.

BSD License

Copyright (c) 2003-2021 Sveinbjorn Thordarson <[email protected]> All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The Platypus application icon is copyright (C) Drífa Thoroddsen.

Issues
  • Slow to show output when using drag and drop or

    Slow to show output when using drag and drop or "open with" ?

    Create an app that opens terminal and does a simple "Hello, World!" echo, the default script, then stays open. Make sure it can accept files by drag and drop and by file selector if none are passed on startup.

    problems

    If I open the app and select a file, it displays the output instantly.

    If I drag a file onto the app and select a file,
    OR
    If I select a file and use use Finder "open with",
    ...there is a long (4–5 seconds) delay before the app shows the output window.

    The app itself opens instantly, it's just the length of time between seeing the app menu and the window appearing.

    issue

    Any ideas?

    opened by gingerbeardman 17
  • Add a menu item to .nib

    Add a menu item to .nib

    First, let me say a huge "thank you" to @sveinbjornt for all his hard work on this most excellent and versatile application. I've already used it to create a bunch of useful Mac apps and I'm blown away. Wow! Thank you!

    I know the focus of Platypus is on simple script execution and not complex interaction, but I've put together a pretty good preferences window for my .app using Pashua, and was hoping to be able to invoke it somehow.

    The ideal way to do this of course would be to add a "Preferences" menu item by editing the .nib file. I can add the menu item, but have no way to link it to any kind of action. I'm a complete Xcode novice and generally find it baffling. I've been able to link the menu item to a few predefined actions but that's about it.

    screen shot 2018-08-11 at 7 53 50 am

    I have a script in my .app bundle that invokes the Pashua window--I just can't figure out how to link it to this menu item or to get it to launch from inside my Platypus app. I know there's a myriad of ways of gathering user input using AppleScript and other types of dialogs, but as the concept of preferences is not really a part of the app workflow, I was hoping for some sort of a solution. Re-running my main script with an argument, launching an external .app, launching a script, anything at all would allow me to open the prefs window.

    Many thanks in advance for help/advice.

    opened by prohtex 15
  • Feature request: Allow to launch binary scripts with arguments

    Feature request: Allow to launch binary scripts with arguments

    Hello, I'm creating some binary python scripts with python and pyinstaller. The result is a one file binary file. I want to drag and drop file on my result binary so that it see the file as first or second argument. Sadly I haven't found any way so far to do that :/ I've tried interpreter /bin/sh + '-exec' + binary_name + file but file argument is not seen as, to work, it needs /bin/sh -exec "binary_name file" and there is no way to put " at the end of the line :/ So if you have any hint :) This would be a very good feature since pyinstaller does not support drag and drop freature and platypus is quite efficient in this area.

    opened by nekopep 15
  • Sparkle Feed Vulnerability

    Sparkle Feed Vulnerability

    Due to the Sparkle Feed Vulnerability can we expect a patched update with a https feed and an update to the patched sparkle framework?

    Thanks

    opened by seansgm 12
  • Do not add Platypus created app to notification center

    Do not add Platypus created app to notification center

    All apps I create with Platypus all show up in System Prefs -> Notifications Center. Is there a way to not have every app I create show up in the notification Center?

    opened by JP-NYC 12
  • Logo/Icon Proposal

    Logo/Icon Proposal

    Hi good day! Im Jibbie Eguna, a graphics designer, I would like to ask for your permission to propose a new designs of logo in your application/project. I would like to help projects in open-source .I would just like to propose new designs if you are needing it. Hoping for your positive response Thank You!

    opened by jbeguna04 12
  • Custom icon is not displayed as expected when added to profile

    Custom icon is not displayed as expected when added to profile

    Original icon (reduced in size) PDF file icon-128

    Platypus screen shot 2019-01-19 at 20 49 34

    If I then use that screenshot PNG as an icon, Platypus looks like this: screen shot 2019-01-19 at 20 50 31

    opened by gingerbeardman 11
  • Embed Python interpreter and the dependent packages with the application

    Embed Python interpreter and the dependent packages with the application

    Hello,

    I used Platypus on my mac to package a python based app. Which works fine on my machine where I've python 3.7.3 and all the packages are installed but it doesn't work on other Mac's where they don't have the interpreter and the dependencies.

    Is there a way to package it with python interpreter and all the packages? I couldn't find anything from the documentation. Please help

    Thanks

    opened by vimkp 10
  • Dark Mode

    Dark Mode "Native" Color for Text Areas

    I've noticed that text areas are not affected by Dark Mode, presumably because Platypus allows setting the background color of these areas manually. I'm wondering if there might be a way to specify a "native" text area color, to more fully support Dark Mode.

    Screen Shot 2019-05-22 at 6 03 44 PM Screen Shot 2019-05-22 at 6 03 04 PM
    opened by prohtex 10
  • Enable closing ⓧ button for text window

    Enable closing ⓧ button for text window

    Is there a way to enable the red window closing button for text windows and web views? It's quite unintuitive that you have to click a separate "Quit" button.

    opened by ad-si 8
  • Share Menu extension?

    Share Menu extension?

    Can I add a Platypus app to the macOS Share Menu?

    opened by jooize 3
  • Notarization

    Notarization

    This is not an issue, but I wanted to share my experience with Platypus users.

    I was able to get Apple's notarization to my application which was generated by Platypus. As the result, I was able to put my app on the public website and let people download and run. Without notarization, macOS 10.15 rejects the execution of downloaded app and there is no way to override it.

    I referred this article as a starting point. Thank you, @dpid

    Prerequisite

    • Xcode is installed on your machine.
    • You understand signing application and notarization. I do not explain about them.
    • You have Apple ID which is registered to Apple developer program, and you have already generated and downloaded Developer ID Application certificate.

    Steps

    All of them are done from command line (Terminal). Please read this document for more details about notarization from command line tools.

    Let's assume your app is generated as ./Example.app and bundle name is com.example.app. Also assume the name of Developer ID Application certificate as "Developer ID Application: Example Company (A1BC234DEF)".

    1. Sign your application.
    chmod -R a+xr ./Example.app
    codesign --deep --force --verify --verbose --timestamp --options runtime --sign "Developer ID Application: Example Company (A1BC234DEF)" ./Example.app
    
    1. Create archive ZIP for notarization. This is different from the final product.
    ditto -c -k --keepParent ./Example.app ./Example.archive.zip
    
    1. Submitting notarization. You might need --asc-provider option if your Apple ID is associated to two or more teams.
    xcrun altool --notarize-app -f ./Example.archive.zip --primary-bundle-id "com.example.app" -u [email protected] -p PassWordForAppleId
    
    1. You should see RequestUUID as the result of previous step. Note that UUID. We assume 12345678-1234-5678-90ab-cdef12345678 here. Type the command periodically until the Status becomes 'success'.
    xcrun altool --notarization-info 12345678-1234-5678-90ab-cdef12345678 -u [email protected]  -p PassWordForAppleId
    
    1. After notarization succeeds, staple the ticket to the package.
    xcrun stapler staple ./Example.app
    
    1. Zip the app as final product. This Example.zip may be put on the public web server, and people may download and run it.
    zip -r ./Example.zip ./Example.app
    

    Notes

    • This is the info as of May 10, 2020.
    • My app is with zsh script, using Text Window UI, and requiring admin privilege. I guess those do not matter for notarization, but I did not verify other variations.
    • Since my app does not use Mac App Store, I cannot say whether this would mean good for Mac App Store or not.
    • Sveinbjorn, Platypus is awesome. This made my script as a real app with very little effort! Thank you, thank you, thank you.
    opened by hohno-panopto 13
  • Register as URI scheme handler seems unreliable

    Register as URI scheme handler seems unreliable

    I'm having some trouble trying to create an app that reliably passes along the URLs sent to it to the script. I'm a new Platypus user (love it so far!), so it's possible I'm doing something wrong, but if so, I can't figure out what. Here's my test setup:

    Create a Platypus app called TestURLs (or whatever) with a Text Window interface, with Accept dropped items checked, and within those settings, I checked Register as URI scheme handler and added http and https as schemes. Use this as the script:

    #!/bin/sh
    
    for arg in "[email protected]" ; do
        echo "arg: '$arg'"
    done
    

    In the terminal, issue the following command:

    open -a TestURLs 'http://example.com' 'http://foobar.com'
    

    Expected output:

    ​arg: 'http://example.com'
    ​arg: 'http://foobar.com'
    

    Actual output varies. Most often, I get the following:

    ​arg: 'http://example.com'
    

    and it loses the second URL. Sometimes I get no output at all, as if no arguments have been passed. Very rarely, I'll get the expected output of both URLs.

    I've verified that if I send the same open command to an ordinary browser, both URLs get opened. For example, this command will open both URLs in Chrome:

    open -a 'Google Chrome' 'http://example.com' 'http://foobar.com'
    

    Any ideas what's going on here?

    Thanks!

    opened by dmarmor 3
  • system unresponsive during script execution of Status Menu app

    system unresponsive during script execution of Status Menu app

    Hi

    during the execution of the script called by a Status Menu App, the system becomes unresponsive. User input in Terminal becomes impossible, one has to ssh into the box to kill the script.

    Steps to reproduce:

    • create a one line ~/sleep.sh : sleep 10
    • create a Platypus Shell script with interface "Status Menu"
    • run app --> system is unresponsive for 10 seconds

    The problem doesn't happen with other user interfaces.

    This is using Platypus 5.2 1008, running on 10.12.6

    hope this is something you could fix?

    opened by michaelcinquin 4
  • Strange behaviour when dragging files on app icon

    Strange behaviour when dragging files on app icon

    Hi!

    I recognized some issues when starting apps built with Platypus by dragging files onto the app icon. With certain files the underlying script runs twice and some files get not passed to the script at all. When the script runs from terminal all is fine. When I start the app first by opening the app and then drag the files into the text window it runs fine as well! So it just behaves weird when files get dragged onto the app icon.

    I used the latest Platypus version (v5.2) on macOS Sierra (v10.12.6) with these settings here: /usr/local/bin/platypus --droppable --app-icon '/Users/nicolasreibnitz/Downloads/Platypus-5.1/Platypus.app/Contents/Resources/PlatypusDefault.icns' --name 'Testscript' --interface-type 'Text Window' --interpreter '/bin/bash' --uniform-type-identifiers 'public.item|public.folder' '/Users/nicolasreibnitz/Documents/git/shell-script-app-template/testscript.sh'

    This is the script for testing: screen shot 2017-12-30 at 22 49 31

    Here is the output in terminal (expected result): screen shot 2017-12-30 at 22 52 47

    The output with Platypus (all in all only 12 files were passed and it ran twice): screen shot 2017-12-30 at 22 54 43

    And finally the output when files were dragged in the text window (all good with expected results.): screen shot 2017-12-30 at 22 56 44

    Different file combinations yield different results and which files were clicked on when dragging seems to change the output as well. All files were recognized, even the three that were not processed in the first Platypus screenshot. But I guess you get the point without me listing all combinations I tried. Oh, and it's not the spaces in the filenames. I checked that as well.

    Finally, here is the app in question. Testscript.app.zip

    In any case: I love Platypus! And I know for a fact that this behaviour is rather new. But using older versions of Platypus didn't help. Maybe it's an OS X issue?

    Thanks in advance!

    opened by NicolasReibnitz 2
  • "Run as administrator" doesn't seem to be working

    Probably, this is broken with the newer Mac OS updates

    opened by arvindsree 20
Releases(5.3)
  • 5.3(Nov 25, 2018)

    • First facelift in a decade: New application icons created by Drífa Líftóra
    • Updated to support Mojave Dark Mode
    • Added AWK, JavaScript and Node interpreter presets
    • Added "REFRESH" command that clears text output buffer
    • Added "DISABLED" menu item syntax for status menu interface
    • Platypus and its command line tool binary are now code-signed. Generated applications remain unsigned, for obvious reasons
    • Windows of generated applications are now larger, and centered on first launch
    • Apps now try to make script executable (+x) on launch This may resolve certain issues with launching generated apps stored on network-mounted volumes
    • Added Open With menu for items in Bundled Files list
    • Fixed bug where Platypus would generate broken custom icns files from images
    • Fixed buggy Uniform Type Identifier validation in command line tool
    • Platypus now validates default bundle identifier in Preferences
    • Removed broken System Profiler example
    • Removed XML plist format feature
    • Documentation overhauled, partially rewritten and moved to Markdown format
    • An assortment of minor bug fixes
    • Various minor interface improvements
    • Reduced size of generated app binaries
    • Now requires macOS 10.8 or later
    Source code(tar.gz)
    Source code(zip)
    platypus5.3.zip(3.14 MB)
Owner
Sveinbjorn Thordarson
Open source programmer.
Sveinbjorn Thordarson
Frugal and native macOS Syncthing application bundle

Syncthing for macOS Introduction syncthing-macos project is a native macOS Syncthing tray application bundle. It bundles its own syncthing instance an

The Syncthing Project 1.3k Sep 19, 2021
A desktop app for inspecting your React JS and React Native projects. macOS, Linux, and Windows.

Join our Community Slack Quick Installation Guide What is Reactotron? Reactotron is a macOS, Windows, and Linux app for inspecting your React JS and R

Infinite Red, Inc. 13.2k Sep 24, 2021
:closed_book: Swift Logging Utility for Xcode Google Docs

QorumLogs Swift Logging Utility in Xcode & Google Docs Log Levels class MyAwesomeViewController: UIViewController { override func viewDidLoad() {

Goktug Yilmaz 782 Aug 28, 2021
An unofficial DevDocs API Documentation viewer for macOS.

DevDocs for macOS An unofficial DevDocs API Documentation viewer for macOS. Features Tabs Global shortcut (Option + Space), customizable Automatic dar

Douglas Teoh 300 Sep 14, 2021
Catch: Broadcatching made easy.

Catch: Broadcatching made easy. Catch is the easiest way to do broadcatching on the Mac. Just add your feeds and new episodes will be downloaded as th

Giorgio Calderolla 387 Aug 23, 2021
SoundCloud for macOS and Windows

What is SoundCleod? SoundCleod is a desktop application which brings SoundCloud to macOS and Windows without using a web browser. Compared to using So

Márton Salomváry 951 Aug 26, 2021
a Cocoa GUI for /etc/hosts

Hosts, a system preference pane to manage your hosts file Hosts adds a preference pane to your system preferences which lets you toggle your host file

Voxin Muyli 1.5k Sep 15, 2021
macOS app that contains a full Ruby installation (for use with Ruby/Gosu)

Ruby.app Universal application wrapper to deploy Ruby apps on OS X (using MRI/C Ruby, not MacRuby or JRuby). So far, it has only been used to release

The Gosu Library 35 Aug 16, 2021
Convenient secure logging during development release in Swift 3, 4 5

Colorful, flexible, lightweight logging for Swift 3, Swift 4 & Swift 5. Great for development & release with support for Console, File & cloud platfor

SwiftyBeaver 5.3k Sep 16, 2021
macOS Initial Access Payload Generator

macOS Initial Access Payload Generator

D00MFist 153 Sep 2, 2021
💻 Democratizing Snippet Management (macOS/Win/Linux)

To Lepton users around the world in more than 130 countries: We hope you all stay safe, healthy, and strong as we get through the COVID-19 pandemic. L

CosmoX 8.9k Sep 23, 2021
A minimal, beautifully designed music player for OS X.

Sonora A minimal, beautifully designed music player for the Mac Developed by Indragie Karunaratne Designed by Tyler Murphy Sonora (previously sold on

Sonora for Mac 925 Sep 12, 2021
Make your battery information a bit more interesting.

Juice ⚡️ Make your battery information a bit more interesting by making your own measurement scale instead of a boring battery indicator. I was browsi

Brian Michel 697 Aug 31, 2021
Jetpack Compose and SwiftUI based Kotlin Multiplatform sample project (based on CityBikes API).

Jetpack Compose and SwiftUI based Kotlin Multiplatform sample project (based on CityBikes API).

John O'Reilly 278 Sep 17, 2021
Hosts file manager for OS X

Gas Mask Gas Mask is simple hosts file manager for macOS. It allows editing of host files and switching between them. System requirements Runs on Lion

Siim Raud 3.3k Sep 17, 2021
Menu bar macOS app for running rkt in a macOS hypervisor CoreOS VM.

RktMachine is a macOS menu bar app providing a CoreOS VM using HyperKit and the macOS Hypervisor. It supports developer workflows using the rkt contai

Woof Woof, Inc. 30 Sep 20, 2021
A simple shortcut menu for macOS

Shuttle A simple shortcut menu for macOS http://fitztrev.github.io/shuttle/ Sidenote: Many people ask, so here's how I have my terminal setup. Install

Trevor Fitzgerald 4.4k Sep 23, 2021
iOS app that detects LaTeX symbols from drawings. Built using PencilKit, SwiftUI, Combine and CoreML for iOS 14 and macOS 11.

DeTeXt Finding the symbol you want to use in LaTeX can be hard since you can't memorize all the possible commands and packages for every symbol you mi

Venkat 25 Sep 21, 2021
Mac app to learn typing and the alphabet

Letters Mac app to learn typing and the alphabet. I wrote this for my 2 year old son who loves typing on the keyboard, looking up at the screen and lo

Klaas Pieter Annema 19 Sep 12, 2021