macOS: allow arbitrary apps or custom commands for "Default open destination"

Open 💬 5 comments Opened Mar 21, 2026 by adityasrini
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

I want to use a custom wrapper app for IntelliJ IDEA LightEdit in the macOS app.

Right now, the "Default open destination" setting appears to offer a fixed set of supported apps such as VS Code, Finder, Terminal, IntelliJ IDEA, and WebStorm. It does not appear to use the normal macOS app picker or LaunchServices app list.

My use case:

  • I want files opened from ChatGPT/Codex to go to IntelliJ LightEdit, which I can launch from the CLI with idea -e.
  • I created a wrapper .app bundle that shells out to idea -e for files and normal idea for directories.
  • I gave the wrapper a bundle ID and registered it with LaunchServices.
  • The wrapper still does not appear in "Default open destination".

Expected behavior:

  • Let users choose any installed .app as the open destination.

A better version:

  • Add a custom command option with a placeholder for the selected path, for example:
  • /path/to/idea -e {path}

Why this matters:

  • Some editors support alternate open modes such as LightEdit.
  • Some users want project folders and single files to open differently.
  • A fixed allowlist blocks valid macOS app workflows even when the app bundle is installed and registered correctly.

Environment:

  • macOS 26.3.1 (a) (25D771280a)
  • Codex Version 26.318.11754 (1100)
  • Reproduced on March 21, 2026

Repro:

  1. Create and register a normal .app wrapper on macOS.
  2. Open ChatGPT/Codex macOS settings.
  3. Go to "Default open destination".
  4. Try to select the wrapper app.

Actual:

  • The wrapper app does not appear.

Expected:

  • The wrapper app appears, or the app exposes a custom command option.

View original on GitHub ↗

5 Comments

github-actions[bot] contributor · 5 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #12988

Powered by Codex Action

adityasrini · 5 months ago

This is not a duplicate of and is more of a super set of the linked #12988 issue. Additionally, the linked issue further links to other closed issues that don't have a clear resolution to this feature request.

rahulxsomething · 5 months ago

Workaround: Use any app as Codex's "Default open destination" on macOS

Codex uses a hardcoded allowlist of known editors for its "Default open destination" dropdown. Custom .app bundles don't appear even when properly registered with Launch Services. This workaround creates a tiny AppleScript app that masquerades as a recognized editor (e.g. TextMate) but routes every file to its real macOS default handler — so files open in whatever app macOS would normally use.

This also works if you want files to always open in a specific app that is NOT already the default macOS handler (like Zed, Alacritty+Neovim, IntelliJ LightEdit, etc.) — just modify the AppleScript in the script below.

Install

Save this as install.sh, run chmod +x install.sh, then ./install.sh:

#!/bin/zsh
set -eo pipefail

APP="/Applications/TextMate.app"

# 1. Create the AppleScript
SCRIPT=$(mktemp /tmp/open-default-XXXXX.applescript)
cat > "$SCRIPT" << 'AS'
on open theFiles
  repeat with aFile in theFiles
    do shell script "open " & quoted form of POSIX path of aFile
  end repeat
end open
AS

# 2. Compile into an app bundle
osacompile -o "$APP" "$SCRIPT"
rm "$SCRIPT"

# 3. Write the Info.plist (must declare Editor role + droplet executable)
cat > "$APP/Contents/Info.plist" << 'PLIST'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>CFBundleName</key>
  <string>TextMate</string>
  <key>CFBundleIdentifier</key>
  <string>com.macromates.TextMate</string>
  <key>CFBundleVersion</key>
  <string>1.0</string>
  <key>CFBundleShortVersionString</key>
  <string>1.0</string>
  <key>CFBundlePackageType</key>
  <string>APPL</string>
  <key>CFBundleSignature</key>
  <string>????</string>
  <key>CFBundleExecutable</key>
  <string>droplet</string>
  <key>CFBundleIconFile</key>
  <string>droplet</string>
  <key>CFBundleDocumentTypes</key>
  <array>
    <dict>
      <key>CFBundleTypeName</key>
      <string>Plain Text</string>
      <key>CFBundleTypeRole</key>
      <string>Editor</string>
      <key>LSItemContentTypes</key>
      <array>
        <string>public.plain-text</string>
        <string>public.utf8-plain-text</string>
        <string>public.source-code</string>
        <string>public.script</string>
        <string>public.shell-script</string>
        <string>public.python-script</string>
        <string>public.ruby-script</string>
        <string>public.perl-script</string>
        <string>public.c-source</string>
        <string>public.c-header</string>
        <string>public.c-plus-plus-source</string>
        <string>public.objective-c-source</string>
        <string>public.swift-source</string>
        <string>public.assembly-source</string>
        <string>public.json</string>
        <string>public.xml</string>
        <string>public.yaml</string>
        <string>com.apple.property-list</string>
        <string>com.netscape.javascript-source</string>
        <string>public.css</string>
        <string>public.html</string>
      </array>
    </dict>
  </array>
  <key>NSAppleEventsUsageDescription</key>
  <string>This app routes files to their default macOS handler.</string>
  <key>LSUIElement</key>
  <true/>
</dict>
</plist>
PLIST

# 4. Register with Launch Services
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f "$APP"

echo "Installed: $APP"

Then open Codex → Settings → Default open destination → select TextMate.

Files will now route through the fake TextMate to their real default macOS handler.

Customization

Want files to open in a specific app instead? Change the do shell script "open " line in the script:

-- Zed:
do shell script "/usr/local/bin/zed " & quoted form of POSIX path of aFile

-- Neovim via Alacritty:
do shell script "open -a Alacritty -- nvim " & quoted form of POSIX path of aFile

-- IntelliJ LightEdit:
do shell script "/usr/local/bin/idea -e " & quoted form of POSIX path of aFile

Already have TextMate installed? Change APP, CFBundleName, and CFBundleIdentifier to a different editor from Codex's allowlist that you don't use:

| Editor | App name | Bundle ID |
|--------------|---------------------|------------------------------|
| TextMate | TextMate.app | com.macromates.TextMate |
| BBEdit | BBEdit.app | com.barebones.bbedit |
| Sublime Text | Sublime Text.app | com.sublimetext.4 |

adityasrini · 5 months ago

Great workaround! Tested it locally and it works! Would still be a good idea to make this natively supported so devs don't have to resort to hacking Applications to tricking Codex to working.

Also, I assume you vibecoded this solution to my vibecoded issue 😄

ypytomets · 2 months ago

How to pass a $LINE and $COLUMN there?