Skip to content

OMC 5.6

Latest

Choose a tag to compare

@abra-code abra-code released this 17 Nov 08:41
· 2 commits to master since this release

OMC 5 requires macOS 14.6 or later. For older macOS versions, use OMC 4.x.

OMC 5.6 is built against ActionUI 0.9.14. The output window, the progress window and the input dialog are now ActionUI windows, and the nib windows behind them are gone. This release also fixes a set of long-standing engine bugs: output with accented letters, CJK text or emoji losing pieces, omc_list_append_items_from_stdin being ignored, lost output in WAIT_FOR_TASK_COMPLETION commands, and Services that hung or mixed up their results. The embedded Python stays at 3.15.2.

Most of the engine's Objective-C code moved to portable C++ in this release. On macOS nothing changes except what is listed below.

Rebuild your applets with AppletBuilder 5.6. The engine fixes and the new windows arrive only when an applet is rebuilt. appletbuilder build --force refreshes the engine even when the version check would skip it.

This is the last release with nib dialogs and OMCService.service. Version 6, now in development, drops both. Applets with NIB_DIALOG windows keep working with the 5.6 engine.

Built-in windows are ActionUI windows

Output window (the *_with_output_window modes):

  • Output is appended at the cost of the new piece, so a command that prints megabytes no longer slows down as the text grows; 2 MB shows in under a second.
  • The default font is Monaco 12, also for a command without OUTPUT_WINDOW_SETTINGS, which used to show Helvetica 12.
  • Without TEXT_COLOR and BACKGROUND_COLOR the window follows the system appearance, light or dark, instead of always black on white.
  • Colors written with a leading #, as in the command reference's examples, now work. They were silently ignored.
  • Text that is not UTF-8 shows as replacement characters instead of being dropped.
  • Command-W closes the window.
  • WINDOW_ALPHA, WINDOW_OPEN_FADE_IN, WINDOW_CLOSE_FADE_OUT and the custom PNG window keys (CUSTOM_*) are removed and ignored. WINDOW_TYPE custom is read as floating. The validator warns about each of them, so delete them from your command files.

Progress window (PROGRESS): the title, the remembered frame, the forward-only bar, the indeterminate mode and the Stop button work as before. A long status line now ends in an ellipsis.

Input dialog (INPUT_DIALOG):

  • Return is OK, Escape is Cancel, and closing the window cancels.
  • The combo box is a text field with a menu of the INPUT_MENU names: a typed name gives its VALUE, any other text is the answer as typed. The pop-up menu starts on the DEFAULT item.
  • INPUT_MENU items may be plain strings, as documented. The dialog used to read only dictionaries with a NAME, so a menu written as the command reference showed was empty in every release. A string is shown and returned as written; a dictionary shows its NAME and returns its VALUE, or else its NAME.
  • A localized INPUT_MENU shows its items again. 5.5 dropped every item when the command had a localization table.
  • A long message is shown in full; the dialog sizes itself to it.

Engine fixes

  • Output with multi-byte characters no longer loses pieces. Output reaches the output window, the status line and Services clients in pieces of up to 512 bytes. A piece that ended in the middle of a character was dropped whole, so output with accented letters, CJK text or emoji lost up to 512 bytes at random places. This was in every release.
  • omc_list_append_items_from_stdin works again. Since 5.1 omc_dialog_control did not recognize it and set the list to one item, the verb's own name.
  • A WAIT_FOR_TASK_COMPLETION command no longer loses its output now and then. The wait could end early, before the command's output was read. This was in every release since 4.3.
  • Scripts start with SIGPIPE at its default. Once a command had written to a script's standard input, every later script in the same applet inherited an ignored SIGPIPE, so in producer | head -n 1 the producer got write errors instead of ending quietly. exe_system commands still inherit the ignored signal.
  • Services:
    • A Service that ran a synchronous command waited forever.
    • Two Services requests that overlapped returned the same mixed text.
    • A Service whose command opened a window could return before its command's output, when the window's init command ended first.
    • A command canceled at its warning, input dialog or blocking window now ends the Service's wait, and a NEXT_COMMAND_ID chain is waited for to its last command.
  • A subcommand of a command run on selected text gets that text. It used to get none.
  • A read error on a command's output is the command's error. It used to be ignored, and a child that exited with 0 counted as success.
  • A Python script runs when the applet has no PATH, or one that is not UTF-8. Both crashed the applet.
  • The Commands menu: a SUBMENU_NAME with a . or .. component no longer crashes the applet, and an absolute or ~ command file path works there as it does for running commands.
  • PASTE_AFTER_EXECUTION asks for the Accessibility permission instead of doing nothing (GitHub issue #18). macOS drops keystrokes sent to other apps by an app without that permission. OMC now checks first: it asks macOS to show the permission prompt once per process, logs which app needs the permission, and sends nothing. For the contextual menu plugin that app is Shortcuts.app; for a Service, the OMC Services app.
  • Private files stay private while they are saved. An atomic write created its temporary file readable by others and set the kept mode only after writing, so the new content of a 0600 property list was briefly readable.
  • The engine's temporary folder is checked to be private. Its files for omc_dialog_control, omc_next_command and the ActionUI remote bridge are still in $TMPDIR, but a folder there that another user made first, or a link, is refused. A Terminal command whose setup script cannot be written runs without it instead of crashing.
  • A window closed and opened again right away comes back at its saved size and position.

plister

  • Keys with accented letters are found. A property path was converted like a file path, which decomposed accented letters, so such a key could be written but never read or removed again. A path is now split on / as written. Keys an older plister wrote in decomposed form are still found. A doubled / no longer ends the path early.
  • An empty string, or the keys of an empty dictionary, no longer print "problem converting UTF-16 string to UTF-8".
  • A property list that does not parse says why, as a JSON file already did ("failed to parse property list: Value missing for key inside at line 2"). The engine reports both formats the same way.

AppletBuilder

  • Updating an applet while it runs no longer kills it and leaves the build unsigned. The new executable is installed as a new file; the running copy keeps the old one until it quits.
  • appletbuilder create --template <name> takes the bundled template of that name before a folder of that name in the current directory. A template or clone source that is not an applet is refused before anything is copied.
  • Services pane: the Input picker gains Folders and Other File Types. Before, every save rewrote a service's input types, so a folders-only or images service turned into one for any file as soon as its title was edited. A failed save now says so.
  • Command editor: a command from Command.json is shown in the file's own key order, so a save no longer reorders its keys, and a reload after an outside change no longer shows XML.
  • Python thinning removes the hashlib and xml extension modules from a Python 3.15 applet too.
  • omctest is about twice as fast. It starts far fewer processes per handler dispatch and per stub call; AgentVM.app's suite went from 33 minutes to 14.5 with the same 3181 checks. OMCTEST_API_VERSION is unchanged at 7.
  • The validator accepts both forms of INPUT_MENU items, warns about the removed output window keys, and gives the real defaults for the output window settings.

ActionUI 0.9.14

Changes since ActionUI 0.9.10, which OMC 5.5 was built against:

  • TextEditor "implementation": "native" draws the editor with AppKit's text view. A value that extends the text is appended without laying out the whole text again, so a growing log stays fast. The new actionui.appendText method on the remote bridge appends text to a field without firing its action; it is append_text in the Python client (omc.window().append_text(...)) and actionui_append_text in the shell client. The default stays SwiftUI's editor.
  • ProgressView: a negative progress (-1) makes the bar indeterminate, also at run time. Setting it to null was refused once the bar had held a number.
  • Menu bar JSON: a Menu inside a CommandMenu, a CommandGroup or another Menu becomes a submenu. It was dropped before.
  • Action context: a Table button with actionContext rowColumnIndex hands its handler {"row": R, "column": C}, and openURLActionID hands the URL as text. Neither had a form a handler could read.
  • getElementInfo lists the window's elements as they are now: removed elements are no longer listed, and an element inserted with a removed one's id has its own type.
  • An element with only "type:apple" and no "type" is left out on other platforms, and the validator now accepts it.
  • Text: text and markdown properties in JSON are only the initial content. To change what a Text shows at run time, set its value. The documentation now says so; the behavior is unchanged.
  • RichText 0.4.2: code blocks with no language are not highlighted, and an apostrophe inside a word no longer starts a string.

Documentation

  • PASTE_AFTER_EXECUTION is documented for the first time: the command copies its result to the clipboard itself, the paste goes to the app in front, and the Accessibility permission is required.
  • Output window settings: the command reference gives the real defaults. AUTO_CLOSE_ON_SUCCESS_ONLY is true, and without AUTO_CLOSE_TIMEOUT the window stays open. The reference used to say false for the first and that a timeout of 0 meant no auto-close.

Compatibility notes

  • The output window looks different: Monaco 12 by default, system colors unless you set them, no transparency or fades, no custom PNG windows. See the first section.
  • $OMC_OMC_SUPPORT_PATH is now .../Abracode.framework/Support, the framework's link to its current version's Support folder, instead of .../Abracode.framework/Versions/Current/Support. Both reach the same tools; a script that compares the path as text sees the difference.
  • OMCSingleCommand, a nib object from 2008 that no applet used, is removed.
  • OMCEdit is no longer a known host.
  • The input dialog's OK and Cancel titles come from the framework's localized strings; the German nib copies are gone with the nibs.

In this distribution

  • AppletBuilder.app - OMC applet development studio.
  • OnMyCommandCM.plugin - contextual menu plugin for use with Shortcuts.app; commands load from ~/Library/Preferences/com.abracode.OnMyCommandCMPrefs.plist.
  • OMCService.service - macOS service template for standalone OMC-based system services. This is its last release; Version 6 drops it.
  • Skill/ - the OMC AI agent skill (three flavors) plus its installer.
  • Scripts/ - codesign_applet.sh, install_contextual_menu_plugin.sh, thin_distribution.sh, OMCApplet.entitlements, and the example com.abracode.OnMyCommandCMPrefs.plist.

See the main OMC README at https://github.com/abra-code/OMC/ for full documentation on commands, runtime context, dialogs, and services.