September 30, 2019
See at github
OnMyCommand is a UNIX shell script and AppleScript executor.
build your own Contextual Menu Item or GUI application.
For more information on building command descriptions see Command Description Manual.
Sources are included with Contextual Menu Workshop. Newest sources are
available on request.
Subscribe to OMC
mailing list to receive OMC-related announcements, seek support,
suggest features or discuss command descriptions.
OMC features in a nutshell:
- You can create a contextual menu item or an applet using UNIX shell script or
- You can specify for the command is to be executed silently, in terminal or with result in output window.
- You may add a path to the clicked file or folder as an argument
of your command.
- You may add a selected text or text from clipboard as an argument
of your command.
CommandDroplet is a small application executing commands in OMC format.
You may use the same command description for contextual menu and for a
standalone applet. CommandDroplet contains exactly one command
description in its resources. Context information is obtained from files dropped on CommandDroplet. Text selection objects cannot be used with CommandDroplet (but clipboard content can be accessed). More detailed information on droplets here.
A command description editor is available as a separate application.
It is called OMCEdit and is written by Knut Lorenzen. Great thanks to Knut for devoting his time to this project. OMCEdit is a great companion to OnMyCommand. More info here.
User contributed command descriptions
Users are encouraged to submit command descriptions via OMCEdit so they
can be shared with other users here.
Classic contextual menu plug-ins are no longer supported in OSX 10.6 and higher. More information available
- Obtaining text context from front Cocoa application usually does not work. Only Shortcuts text context provides in specific apps can obtain text context via AppleScript.
- Finder item selection is unreliable starting with OSX 10.7. When you select item in one window, switch to another window and selecting a different item, Finder sometimes returns the first selection as the current one. A radar bug was opened with Apple long time ago and it does not seem to be high on their priority list.
- Starting with OSX 10.8 Apple removed support for ~/.MacOSX/environment.plist, leaving it only for Terminal.app. This means that if you have a script or tool, which relies on some environment viable set there it will work in Terminal.app but it will not work when executed via OMC. As a workaround you may use /OMC/Additional Tools/plist_env.sh in your command to set the env variables from ~/.MacOSX/environment.plist.
- Starting with Xcode 4 Apple removed support for editing nib files with Interface Builder 3 plug-ins. For more information refer to "Custom nib dialogs.rtfd" document.
What people say about OnMyCommand
- If you want to learn what users think about it, please see
comments at MacUpdate.
- David Kadavy wrote a hands-on introduction to OMC with example commands.
- A nice "Getting started" tutorial by Ross McKillop.
- If you speak French, a good introduction to OMC was written by
Fabien Conus. Read it here.
- Yet another article in French is here.
DOWNLOAD LATEST VERSION:
OPEN SOURCE AT GITHUB
4.0 (OMC 4.0 is open source now at github)
- Added the ability to accept file or text drags in nib dialog OMCButton. The way it works that you can enable this behavior in the nib button by adding boolean property “acceptFileDrop” or “acceptTextDrop” in “User Defined Runtime Attributes”. Such OMCButton should also have “commandID” property corresponding to the command that the button will trigger. A drop of file or text on such button will run the specified command with the proper file or text context that can be accessed via $OMC_OBJ_PATH or $OMC_OBJ_TEXT in that command. See “Drag And Drop Button.droplet” example in /Applications/OMC/Examples/Droplets
- plister additions:
- added “get keys” command to get all keys from dictionary
- added “get key” support to “iterate” command
More information in “Additional Tools/plister description.txt” or run “/Library/Frameworks/Abracode.framework/Support/plister” for help
- Minor bug fixes and internal code cleanup
- Fixed a crash and other minor bugs
- Droplets now can be customized to handle URL schemes
- Droplets can have optional input files and their presence can be inspected by a startup script
- New "pasteboard" command line tool for putting and retrieving text from named (private) pasteboards
- Fixed memory leaks and other minor bugs
- Added system services support
- New filt tool for regular expression search-replace
- New alert command line tool, which displays GUI alert dialog and waits for user interaction
- Added OMC_NIB_TABLE_NNN_COLUMN_MMM_ALL_ROWS to obtain all row values from table in custom nib dialogs
- Added support for specifying escape sequence for whitespace characters like \n \r \t for prefix/suffix/separator strings
- Other smaller changes bug fixes
- Requires Mac OS 10.6 or higher
- Online command collection contains over 670 commands.
- Added OMCComboBox for custom nibs
- Added ability to disable or enable the whole OMCView or OMCBox with all its subviews in custom nibs
- Brought back the editable nibs in CommandDroplet's MainMenu.nib so they are customizable after you build a droplet
- A new option for navigation dialogs to allow or disallow sharing of the same selected path between subcommands
- Knut updated OMCEdit to support new navigation dialog option and added a couple of bug fixes and enhancements
- 64-bit binaries for execution in 64-bit Shortcuts in Mac OS 10.6
- Internal rewrite of several components to remove Carbon code
- Added support for localization of commands
- Added table support in custom Cocoa dialogs
- Knut updated OMCEdit with support for newest features
- Mac OS 10.4 no longer supported
- New progress dialog which allows translating command output text
into GUI progress
- Added support for more controls in custom Cocoa dialogs (tab
view, custom view, scroller views, path control)
- Added new ways to control custom Cocoa dialogs from your command,
including sending Obj-C messages to controls right from your script.
- Brought back PowerPC G3 support lost in version 2.0
- Knut updated OMCEdit with support for new progress dialog
options, bug fixes and version checking (Help menu)
- A bunch of bug fixes
- Separation of common code and resources into shared
- New Cocoa OMCEdit with new interface and features written by Knut
- AbracodeQC.plugin: a Quartz Composer plugin for executing OMC
commands (OS 10.5-only)
- Support for custom nib-based Cocoa dialogs (Xcode & Interface
Builder 3.x required)
- Part of the interface rewritten in Cocoa
- Command droplets are now Cocoa.
- Separate downloadable icon packs for building droplets
- Reimplemented popen with OMC's own version: omc_popen()
- Added POPEN_SHELL for customizing the shell (and flags) executed
- Added environment variable export for popen-based execution
modes: __OBJ_PATH__ becomes "$OMC_OBJ_PATH" and so on
- STANDARD_INPUT_PIPE - allows piping of context information to a
tool excuted in COMMAND
- Added new activation option: checking file name, path or selected
text for a match
- Mac OS 10.5 compatibility: Terminal.app lost its creator code
('trmx') so it must be identified by its bundle id (com.apple.Terminal)
when sending AppleEvents
- Mac OS 10.5 compatibility: recompiled to support loading in
Garbage Collection-enabled applications
- Fixed versioning code in OMC to support Mac OS 10.4.10 and higher
- Fixed a problem that error returned from script should stop all
post execution actions
- Fixed menu separator problem in dialog popup menus (was showing
as "-" instead of real separator)
- Worked around a bug in Core Foundation related to bundles
- Fixed a crash when executing empty command with popen
- Some execution modes are now asynchronous: the host application
is no longer blocked during command execution and can be responsive.
The default popen() execution mode is now asynchronous.
- Added task manager with an option to specify maximum number of
- Added progress dialog
- Added task end notification. Many tasks execute asynchronously
now so the end notification is useful.
- Fixed a problem with AppleScript executor ignoring
handlers/subroutines defined after main script (long standing issue).
- Added DataBrowser control (list view) support for nib dialogs.
This allows creation of dynamic lists and tables
- Item name upgraded to array of strings with special objects to
allow dynamic names
- NAME_PLURAL key defined so the menu name may be different when
more than one file is selected
- Standard default location for external ".omc" modules:
- DropletBuilder updated to install .omc modules; also validates
droplets before upgrading
- Output window fade in and fade out re-implemented using Apple API
for smoother effect
- Implemented dragging of custom output window if the click is
outside of "close" rectangle
- New method of output window positioning
- Option to show invisible files and folders in navigation dialogs
- Option to set default location for navigation dialogs
- CommandDroplet navigation dialog displayed on startup now allows
- Reimplemented input dialog using nib dialogs
- iTerm startup shell support
- Non-blocking nib dialogs
- Termination handlers for nib dialogs (analogous to dialog
- New properties for text view control in nib dialogs: text font
- Added initial keyboard focus for text fields in nib dialogs
- Ability to override escaping method in nib controls
- Added new escaping method: esc_with_percent_all
- Bug fix: escape FRONT_APPLICATION_NAME according to current
- External bundle special word: __MY_EXTERNAL_BUNDLE_PATH__
- Expanding tilde in EXTERNAL_BUNDLE_PATH and REFRESH_PATH
- Added statically assigned next command id
- Multiple objects sorting
- plister tool updated with new commands: find, findall, iterate;
"get string" & "find string" may now be used on arrays and
- b64 tool with new i/o options
- added new examples
- Knut Lorenzen updated OMCEdit to support all new features
- Re-enabled Mac OS 10.3.9 support
- New feature: modify command ids of nib dialog controls on the fly
- New droplet preference: "Run main command when reopening"
- Bug fix: quit command handled in droplets when nib dialog is shown
- DropletBuilder is now able to update existing droplet to the
newest OMC engine.
- Universal binaries
- New ESCAPE_SPECIAL_CHARS option:
- New option for output window auto close:
- New method of dynamic menu population in nib dialogs with
omc_dialog_control tool by reading items from file or standard input:
omc_list_append_items_from_file and omc_list_append_items_from_stdin
- Updated plister tool to print array and dictionary values when
using "plister get value ..." command
- New Beginner's Tutorial
- Multilevel submenus in contextual menu
- Output window auto close timeout.
- Support for adding and removing popup menu items at runtime (in
- Default filename for "Save as" dialog
- Default text with objects for input dialog
- New special words: __FRONT_APPLICATION_NAME__ &
- Version requirements checking
- Disable/Enable without removing command from the list
- Additional tools: plister & b64
- Support for sending tasks to background application (OMCDeputy)
- Output windows with custom shape and background defined by PNG
- Fade in and fade for output windows.
- Subcommands. Subcommands use the same command description format
but use a special command identifier
- Next command can be scheduled with "omc_next_command" CLI tool so
your script can decide at runtime if another subcommand should follow.
- More controls supported in nib dialogs, including pictures,
icons, bevel buttons, static text, progress controls, tab control.
Controls can trigger subcommands
- "omc_dialog_control" command line tool to set control values in
- Nib dialog initialization with subcommand
- Support external bundles for putting nibs and custom window PNG
images outside of the main bundle
- Option to replace line endings for __OBJ_TEXT__
- Send text to Terminal as a 2 byte Unicode for much better support
of non-ASCII characters.
- __DLG_INPUT_TEXT__ is now escaped according to the escape method
described by ESCAPE_SPECIAL_CHARS
- Enhanced Droplet Builder with support for custom application
icons. Icons courtesy of Scott Chitwood
- Some execution errors are now printed to Console so it is easier
to debug a command.
- Full support for shell scripts. Finally you can use perl, python
or other scripting language directly in your command.
- New activation option for contextual menu to tell in which
applications the command should or must not show.
- Dialogs may now be built directly in Interface Builder and
control values are easily accessed in command description.
- Included DropletBuilder application for easy droplet application
creation and upgrading incomplete ".droplet" stubs to full apps.
- Fixed a bug involving text selection and a dialog in Carbon
applications in Mac OS 10.3
- CommandDroplet - small application executing OMC commands. You
can create standalone applets using the same command description format.
- Direct AppleScript support. You can put AppleScript code into
command description, no need to go through osascript call.
- Output window to see the result of command execution. In many
cases it eliminates the need to send the command to terminal.
- An option to paste clipboard content after command execution.
Most useful in text context with pbcopy or AppleScript's set
the clipboard to...
- Bug fixes. Most important fix involves a long standing bug with popen
execution mode aborting some commands. Now you should be able to
execute almost anything in popen mode.
- Knut Lorenzen's OMCEdit is now included with the main OnMyCommand
- Discussion forums. Some users expressed interest in having a
place to discuss command descriptions.
- BlackTree's QuickSilver now supports OMC commands as actions. You
can download the plug-in for QuickSilver here.
Give it a try!
- Worked around a problem with objects in Finder's column view in
Mac OS 10.3.
- Internal changes for Mac OS 10.3 Panther compatibility.
- Extensive reorganization of special words: dialog words now take
form of __DLG_XXX__. Old style names are still recognized for backward
compatibility but are not recommended.
- Three new Navigation Services dialogs have been added: choose
file, choose folder and choose object (file or folder)
- Two new execution modes have been added: silent execution using
system() call and terminal execution using iTerm.
- Added "Save As..." dialog. The path chosen with "Save As..." can
be passed to CLI as a command argument.
- New dialog type for input text is added: combo box. The dialog is
shown with edit field and popup choice. Handy for pre-defined items but
allows entering custom value.
- Fixed a problem with "text in clipboard" context when a selected
text was always preferred even if the context was explicitly "clipboard
- Changed the behavior of "Always" context. Now always means truly
always, no matter what is the context. Any application supporting
contextual menus will display the item. However, this exposes
contextual menu bugs in some applications (Camino, Safari, possibly
others). Please read the "Known Problems" section for details.
- Fixed a bug which caused strange problems in Carbon applications
(CodeWarrior or BBEdit Lite). The symptom was that all controls,
including scrollbars, were grayed out after contextual menu was invoked
on empty text selection. Thanks to Jayson Adams for providing a quick
solution. This bug was introduced in version 1.5.
- Fixed a bug which caused a crash in Internet Explorer. This bug
was introduced in version 1.5. Thanks to Ira Ruben for reporting this
problem. This is a recommended upgrade since this bug may show in other
programs as well.
- Text selection now works in Cocoa applications thanks to the code
submitted by Cocoa guru Jayson Adams of Circus Ponies Software.