OpenInOtty: Open the current directory in Otty with one click from the Finder toolbar
·(edited)· / , , , , · reads0AI-written
This article was last modified on . Some content may be outdated. Feel free to ask the author if you have questions.
AI TranslationSimplified ChineseEnglish
Summary:
OpenInOtty is a minimal macOS Finder toolbar app: click the icon to open an Otty terminal in the current Finder path. If Otty is already running, it opens a new tab; if not, it launches Otty and navigates to the directory. MIT licensed, single-file Swift implementation.
OpenInOtty is a minimal macOS Finder toolbar app: click the toolbar icon in Finder and it opens a terminal in the current directory using Otty.
When writing code or tweaking configs on a daily basis, you often find yourself already in a folder in Finder, only to open a terminal and cd your way back to the same path. Otty is a great terminal, but there's no native way to jump straight from Finder into Otty with one click.
OpenInOtty reduces that to a single icon on the toolbar:
Click → grab the current Finder window path
Otty is already running → use otty-cli tab new --cwd <path> to open a new tab
Otty is not running → use otty-cli open <path> to launch and enter the directory
No Finder window available → fall back to the Desktop
On failure, show an NSAlert — no silent swallowing of errors
The app uses LSUIElement: no Dock icon, no persistent menu bar. Click once, send the command, and exit — no background footprint.
Requirements
Dependency
Version / Notes
macOS
12.0 Monterey or later
Xcode
15+ (the free App Store version is fine)
Otty
Installed at the default path /Applications/Otty.app
Hold ⌘ and drag /Applications/OpenInOtty.app to the Finder toolbar.
On the first click, macOS will ask for Apple Events / Automation permissions — choose Allow.
If you accidentally declined, you can reset permissions and try again:
BASH
tccutil reset AppleEvents com.local.OpenInOtty
You can also check in System Settings: Privacy & Security → Automation (OpenInOtty → Finder).
How it works (simplified)
The implementation is concentrated in a single main.swift (roughly one hundred lines), with no AppDelegate and no persistent event loop:
Use ScriptingBridge to read the frontmost Finder window's path (finderPath())
Check whether Otty (bundle ID io.appmakes.otty) is running
Call /Applications/Otty.app/Contents/MacOS/otty-cli to open a tab or launch
Show an error dialog on failure; on success, immediately exit(0)
Note
Path resolution doesn't follow the usual "Swift @objc optional protocol + respondsToSelector" path. ScriptingBridge's private subclasses return false for dynamically forwarded methods, causing all calls to be nil, and even the TCC authorization dialog won't appear. Using perform(NSSelectorFromString:) is what actually delivers the Apple Event.
Quick reference for AI agents
Item
Value
Bundle ID
com.local.OpenInOtty
Install path
/Applications/OpenInOtty.app
Otty path
/Applications/Otty.app
Otty CLI
.../Contents/MacOS/otty-cli
UI type
LSUIElement = true
⌘ dragging to the toolbar must be done by the user; agents should not fabricate bundle IDs or Otty paths.
FAQ
Clicking does nothing?
Make sure Otty is at /Applications/Otty.app, and check Automation permissions. If the permission entry is missing, use the tccutil reset reset above and try again.
Opens the Desktop instead of the current folder?
You need at least one non-minimized Finder window; minimized windows are not treated as the current directory.
Summary
If you use Otty daily and like browsing project folders in Finder, OpenInOtty condenses "navigate → terminal" into a single toolbar click. Short source code, no background process, MIT open source.
OpenInOtty is a minimal macOS Finder toolbar app: click the toolbar icon in Finder and it opens a terminal in the current directory using Otty.
Repository: github.com/pintaste/OpenInOtty (MIT). Inspired by OpenInTerminal-Lite.
What problem does it solve?
When writing code or tweaking configs on a daily basis, you often find yourself already in a folder in Finder, only to open a terminal and cd your way back to the same path. Otty is a great terminal, but there's no native way to jump straight from Finder into Otty with one click.
OpenInOtty reduces that to a single icon on the toolbar:
The app uses LSUIElement: no Dock icon, no persistent menu bar. Click once, send the command, and exit — no background footprint.
Requirements
Installation
If you accidentally declined, you can reset permissions and try again:
You can also check in System Settings: Privacy & Security → Automation (OpenInOtty → Finder).
How it works (simplified)
The implementation is concentrated in a single main.swift (roughly one hundred lines), with no AppDelegate and no persistent event loop:
Path resolution doesn't follow the usual "Swift @objc optional protocol + respondsToSelector" path. ScriptingBridge's private subclasses return false for dynamically forwarded methods, causing all calls to be nil, and even the TCC authorization dialog won't appear. Using perform(NSSelectorFromString:) is what actually delivers the Apple Event.
Quick reference for AI agents
⌘ dragging to the toolbar must be done by the user; agents should not fabricate bundle IDs or Otty paths.
FAQ
Clicking does nothing?
Make sure Otty is at /Applications/Otty.app, and check Automation permissions. If the permission entry is missing, use the tccutil reset reset above and try again.
Opens the Desktop instead of the current folder?
You need at least one non-minimized Finder window; minimized windows are not treated as the current directory.
Summary
If you use Otty daily and like browsing project folders in Finder, OpenInOtty condenses "navigate → terminal" into a single toolbar click. Short source code, no background process, MIT open source.