### Install OpenInTerminal-Lite and OpenInEditor-Lite via Homebrew Source: https://github.com/ji4n1ng/openinterminal/blob/master/Resources/README-Lite.md Use these commands to install the applications using the Homebrew package manager. ```bash brew install --cask openinterminal-lite brew install --cask openineditor-lite ``` -------------------------------- ### Install Hammerspoon and fileicon via Homebrew Source: https://github.com/ji4n1ng/openinterminal/blob/master/Resources/README-Lite.md Use these commands to install the necessary utilities for icon automation. ```bash brew install --cask hammerspoon ``` ```bash brew install fileicon ``` -------------------------------- ### Install OpenInTerminal via Homebrew Source: https://github.com/ji4n1ng/openinterminal/blob/master/Resources/README-tr.md Use Homebrew to install the OpenInTerminal application on macOS. ```bash brew install --cask openinterminal ``` -------------------------------- ### Set Custom Default Terminal Source: https://github.com/ji4n1ng/openinterminal/blob/master/Resources/README-Lite.md Example of setting a custom application like GitHub Desktop as the default terminal. ```bash defaults write wang.jianing.app.OpenInTerminal-Lite LiteDefaultTerminal GitHub\ Desktop ``` -------------------------------- ### Get Selected Paths from Finder Source: https://context7.com/ji4n1ng/openinterminal/llms.txt Use FinderManager to retrieve the full URL or path of the frontmost Finder window or selected files. Handles errors if Finder cannot be accessed. ```swift import OpenInTerminalCore let finderManager = FinderManager.shared // Get single URL to front Finder window or selected file do { let url = try finderManager.getFullUrlToFrontFinderWindowOrSelectedFile() // Returns: Optional(file:///Users/user/Documents/) } catch OITError.cannotAccessFinder { print("Cannot access Finder") } ``` ```swift // Get single path as String do { let path = try finderManager.getFullPathToFrontFinderWindowOrSelectedFile() // Returns: "/Users/user/Documents" } catch { print("Error: \(error)") } ``` ```swift // Get multiple URLs (for multi-selection) do { let urls = try finderManager.getFullUrlsToFrontFinderWindowOrSelectedFile() // Returns: [file:///Users/user/file1.txt, file:///Users/user/file2.txt] } catch { print("Error: \(error)") } ``` ```swift // Get directory path (if file selected, returns parent directory) do { let directoryPath = try finderManager.getPathToFrontFinderWindowOrSelectedFile() // Returns: "/Users/user/Documents" (even if a file was selected) } catch { print("Error: \(error)") } ``` ```swift // Get desktop path as fallback if let desktopPath = finderManager.getDesktopPath() { print(desktopPath) // "/Users/user/Desktop" } ``` ```swift // Get all installed applications let installedApps = finderManager.getAllInstalledApps() // Returns: Set containing app names like "Visual Studio Code", "iTerm", etc. // Searches: /Applications, ~/Applications, JetBrains Toolbox, Nix Apps ``` -------------------------------- ### Test custom application support Source: https://github.com/ji4n1ng/openinterminal/blob/master/Resources/README-Config.md Verify if a custom application is supported by attempting to open a path with the open command. ```bash open -a GitHub\ Desktop ~/Desktop ``` -------------------------------- ### Managing App Instances and Opening Files Source: https://context7.com/ji4n1ng/openinterminal/llms.txt The App struct handles application configuration and provides methods for launching apps with specific paths in either sandbox or non-sandbox modes. ```swift import OpenInTerminalCore // Create an App instance var app = App(name: "Visual Studio Code", type: .editor) app.bundleId = "com.microsoft.VSCode" app.path = "/Applications/Visual Studio Code.app" // Open app outside sandbox (main app mode) // This gets the current Finder selection and opens the app do { try app.openOutsideSandbox() // For terminals: opens at the selected directory // For editors: opens all selected files/folders } catch OITError.cannotAccessApp(let name) { print("Cannot access \(name)") } catch OITError.cannotCreateAppleScript(let source) { print("Failed to create AppleScript: \(source)") } // Open app in sandbox mode (Finder extension mode) let urls = [URL(fileURLWithPath: "/Users/user/Documents")] do { try app.openInSandbox(urls) } catch { print("Error: \(error.localizedDescription)") } ``` -------------------------------- ### Implement FinderSync Class Source: https://context7.com/ji4n1ng/openinterminal/llms.txt Swift implementation for the Finder extension, handling directory monitoring, context menus, and path selection. ```swift import FinderSync import OpenInTerminalCore class FinderSync: FIFinderSync { override init() { super.init() // Set up directory monitoring for all mounted volumes let finderSync = FIFinderSyncController.default() if let mountedVolumes = FileManager.default.mountedVolumeURLs( includingResourceValuesForKeys: nil, options: [.skipHiddenVolumes] ) { finderSync.directoryURLs = Set(mountedVolumes) } } // Toolbar item configuration override var toolbarItemName: String { "Open in Terminal" } override var toolbarItemToolTip: String { "Open current directory in Terminal." } override var toolbarItemImage: NSImage { NSImage(named: "Icon")! } // Build context menu based on menu kind and user preferences override func menu(for menuKind: FIMenuKind) -> NSMenu { switch menuKind { case .contextualMenuForContainer, .contextualMenuForItems: guard !DefaultsManager.shared.isHideContextMenuItems else { return NSMenu() } return DefaultsManager.shared.isCustomMenuApplyToContext ? createCustomMenu() : createDefaultMenu() case .toolbarItemMenu: return DefaultsManager.shared.isCustomMenuApplyToToolbar ? createCustomMenu() : createDefaultMenu() default: return NSMenu() } } // Get selected paths from Finder func getSelectedPathsFromFinder() -> [URL] { var urls = [URL]() if let items = FIFinderSyncController.default().selectedItemURLs(), items.count > 0 { urls.append(contentsOf: items) } else if let url = FIFinderSyncController.default().targetedURL() { urls.append(url) } return urls } // Open an app with selected paths func open(_ app: App) { let urls = getSelectedPathsFromFinder() do { try app.openInSandbox(urls) } catch { print("Failed to open \(app.name)") } } // Copy path to clipboard @objc func copyPathToClipboard() { let urls = getSelectedPathsFromFinder() var paths = urls.map { $0.path } if DefaultsManager.shared.isPathEscaped { paths = paths.map { $0.specialCharEscaped() } } NSPasteboard.general.clearContents() NSPasteboard.general.setString(paths.joined(separator: "\n"), forType: .string) } } ``` -------------------------------- ### Terminal Configuration Options Source: https://github.com/ji4n1ng/openinterminal/blob/master/Resources/README-Config.md Alternative command strings for different terminal emulators. ```text // kitty: "open -na kitty --args /opt/homebrew/bin/nvim PATH" // WezTerm: "open -na wezterm --args start /opt/homebrew/bin/nvim PATH" // Alacritty: "open -na Alacritty --args -e /opt/homebrew/bin/nvim PATH" ``` -------------------------------- ### Enable Finder Extension via UUID Source: https://github.com/ji4n1ng/openinterminal/blob/master/Resources/README-Config.md Enable the extension manually using the UUID obtained from the pluginkit command. ```bash $ pluginkit -e "use" -u "F2547F13-4E43-4E88-9D8F-56DF05C020D8" ``` -------------------------------- ### Configure Custom Kitty Command Source: https://context7.com/ji4n1ng/openinterminal/llms.txt Sets a custom command for the OpenInTerminal-Lite application to launch Kitty. ```bash defaults write wang.jianing.app.OpenInTerminal-Lite KittyCommand \ "open -na kitty --args --single-instance --instance-group 1 --directory" ``` -------------------------------- ### Configure Hammerspoon for Automatic Icon Switching Source: https://github.com/ji4n1ng/openinterminal/blob/master/Resources/README-Lite.md Add this script to ~/.hammerspoon/init.lua to toggle application icons based on the system dark mode setting. ```lua local function setOpenInEditorLiteIcon(dark) -- Change the path in case of a different install location local appPath = "/Applications/OpenInEditor-Lite.app" -- Change the type accordingly to the icon you want to use (editor, atom, sublime, vscode) local iconType = "editor" local iconsFolder = hs.fs.currentDir() .. "/Icons" local theme = dark and "dark" or "light" hs.execute('fileicon set "' .. appPath .. '" "' .. iconsFolder .. "/icon_" .. iconType .. "_" .. theme .. '.icns"', true) end local function setOpenInTerminalLiteIcon(dark) -- Change the path in case of a different install location local appPath = "/Applications/OpenInTerminal-Lite.app" -- Change the type accordingly to the icon you want to use (terminal, iterm, hyper) local iconType = "terminal" local iconsFolder = hs.fs.currentDir() .. "/Icons" local theme = dark and "dark" or "light" hs.execute('fileicon set "' .. appPath .. '" "' .. iconsFolder .. "/icon_" .. iconType .. "_" .. theme .. '.icns"', true) end local function updateIcons() darkMode = (hs.settings.get("AppleInterfaceStyle") == "Dark") setOpenInEditorLiteIcon(darkMode) setOpenInTerminalLiteIcon(darkMode) end updateIcons() hs.settings.watchKey("dark_mode", "AppleInterfaceStyle", function() updateIcons() end) ``` -------------------------------- ### Configure Defaults via Command Line Source: https://context7.com/ji4n1ng/openinterminal/llms.txt Use the defaults command to set preferred terminals and editors for OpenInTerminal-Lite and OpenInEditor-Lite. ```bash # Set default terminal for OpenInTerminal-Lite defaults write wang.jianing.app.OpenInTerminal-Lite LiteDefaultTerminal iTerm defaults write wang.jianing.app.OpenInTerminal-Lite LiteDefaultTerminal Alacritty defaults write wang.jianing.app.OpenInTerminal-Lite LiteDefaultTerminal kitty defaults write wang.jianing.app.OpenInTerminal-Lite LiteDefaultTerminal Warp # Set default editor for OpenInEditor-Lite defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor "Visual Studio Code" defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor "Sublime Text" defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor PyCharm defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor "IntelliJ IDEA" # Reset default terminal/editor selection defaults remove wang.jianing.app.OpenInTerminal-Lite LiteDefaultTerminal defaults remove wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor ``` -------------------------------- ### Configure Custom Neovim Commands Source: https://context7.com/ji4n1ng/openinterminal/llms.txt Sets custom commands for OpenInEditor-Lite to launch Neovim within specific terminal emulators. ```bash # Using kitty: defaults write wang.jianing.app.OpenInEditor-Lite NeovimCommand \ "open -na kitty --args /opt/homebrew/bin/nvim PATH" # Using WezTerm: defaults write wang.jianing.app.OpenInEditor-Lite NeovimCommand \ "open -na wezterm --args start /opt/homebrew/bin/nvim PATH" # Using Alacritty: defaults write wang.jianing.app.OpenInEditor-Lite NeovimCommand \ "open -na Alacritty --args -e /opt/homebrew/bin/nvim PATH" ``` -------------------------------- ### Enable Finder Extension Source: https://context7.com/ji4n1ng/openinterminal/llms.txt Commands to identify and enable the Finder extension on macOS 15+. ```bash pluginkit -mAD -p com.apple.FinderSync -vvv pluginkit -e "use" -u "YOUR-UUID-HERE" ``` -------------------------------- ### Customize Kitty Launch Command Source: https://github.com/ji4n1ng/openinterminal/blob/master/Resources/README-Config.md Update the Kitty launch command configuration. Ensure the username and arguments are adjusted for your environment. ```bash defaults write /Users//Library/Group\ Containers/group.wang.jianing.app.OpenInTerminal/Library/Preferences/group.wang.jianing.app.OpenInTerminal.plist KittyCommand "open -na kitty --args --single-instance --instance-group 1 --directory" ``` -------------------------------- ### Kitty Launch Behavior Source: https://github.com/ji4n1ng/openinterminal/blob/master/Resources/README-Lite.md Commands to view or customize the default launch arguments for the Kitty terminal. ```bash open -na kitty --args --single-instance --instance-group 1 --directory ``` ```bash defaults write wang.jianing.app.OpenInTerminal-Lite KittyCommand "open -na kitty --args --single-instance --instance-group 1 --directory" ``` -------------------------------- ### Default Kitty Launch Behavior Source: https://github.com/ji4n1ng/openinterminal/blob/master/Resources/README-Config.md The default command used by OpenInTerminal to launch Kitty. ```bash open -na kitty --args --single-instance --instance-group 1 --directory ``` -------------------------------- ### Configure iTerm Tab or Window Behavior Source: https://github.com/ji4n1ng/openinterminal/blob/master/Resources/README-Lite.md Set the default behavior for opening new terminal instances in iTerm. ```bash # Open a new Tab defaults write com.googlecode.iterm2 OpenFileInNewWindows -bool false # Open a new Window defaults write com.googlecode.iterm2 OpenFileInNewWindows -bool true ``` -------------------------------- ### Configure Neovim Terminal Command Source: https://github.com/ji4n1ng/openinterminal/blob/master/Resources/README-Config.md Update the Neovim launch command to use a specific terminal emulator. Replace placeholders with your actual username and path. ```bash defaults write /Users//Library/Group\ Containers/group.wang.jianing.app.OpenInTerminal/Library/Preferences/group.wang.jianing.app.OpenInTerminal.plist NeovimCommand "open -na wezterm --args start /opt/homebrew/bin/nvim PATH" ``` -------------------------------- ### Manage User Preferences with DefaultsManager Source: https://context7.com/ji4n1ng/openinterminal/llms.txt Configure default terminal and editor applications, launch at login, status bar visibility, context menu items, and iTerm specific settings. Supports custom commands and resetting all preferences. ```swift import OpenInTerminalCore let defaults = DefaultsManager.shared // Set/get default terminal defaults.defaultTerminal = SupportedApps.iTerm.app let terminal = defaults.defaultTerminal // App(name: "iTerm", type: .terminal) // Set/get default editor defaults.defaultEditor = SupportedApps.vscode.app let editor = defaults.defaultEditor // App(name: "Visual Studio Code", type: .editor) // Lite version settings defaults.liteDefaultTerminal = "iTerm" defaults.liteDefaultEditor = "Visual Studio Code" // Launch at login setting defaults.isLaunchAtLogin = true // Hide status bar icon defaults.isHideStatusItem = false // Hide context menu items defaults.isHideContextMenuItems = false // Quick toggle feature defaults.isQuickToggle = true defaults.quickToggleType = .openWithDefaultTerminal // Options: .openWithDefaultTerminal, .openWithDefaultEditor, .copyPathToClipboard // iTerm new window/tab option defaults.setNewOption(.iTerm, .tab) // Open in new tab defaults.setNewOption(.iTerm, .window) // Open in new window let iTermOption = defaults.getNewOption(.iTerm) // .tab or .window // Custom menu configuration defaults.isCustomMenuApplyToToolbar = true defaults.isCustomMenuApplyToContext = true // Custom menu icon option defaults.customMenuIconOption = .original // .no, .simple, or .original // Path escaping for clipboard defaults.isPathEscaped = true // Custom kitty command defaults.kittyCommand = "open -na kitty --args --single-instance --instance-group 1 --directory" // Custom neovim command defaults.neovimCommand = "open -na kitty --args /opt/homebrew/bin/nvim PATH" // Get open command for an app let openCmd = defaults.getOpenCommand(SupportedApps.vscode.app) // Returns: "open -a Visual\ Studio\ Code" let kittyCmd = defaults.getOpenCommand(SupportedApps.kitty.app) // Returns custom kitty command with proper arguments // Reset all settings defaults.removeAllUserDefaults() ``` -------------------------------- ### Set Default Terminal or Editor Source: https://github.com/ji4n1ng/openinterminal/blob/master/Resources/README-Lite.md Configures the default application for terminal or editor operations using the defaults write command. ```bash defaults write wang.jianing.app.OpenInTerminal-Lite LiteDefaultTerminal Alacritty ``` ```bash defaults write wang.jianing.app.OpenInTerminal-Lite LiteDefaultTerminal kitty ``` ```bash defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor TextEdit ``` ```bash defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor VSCodium ``` ```bash defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor BBEdit ``` ```bash defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor Visual\ Studio\ Code\ - Insiders ``` ```bash defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor TextMate ``` ```bash defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor CotEditor ``` ```bash defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor MacVim ``` ```bash defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor Typora ``` ```bash defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor neovim ``` ```bash defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor Nova ``` ```bash defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor Cursor ``` ```bash defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor AppCode ``` ```bash defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor CLion ``` ```bash defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor GoLand ``` ```bash defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor IntelliJ\ IDEA ``` ```bash defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor PhpStorm ``` ```bash defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor PyCharm ``` ```bash defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor RubyMine ``` ```bash defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor WebStorm ``` ```bash defaults write wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor Android\ Studio ``` -------------------------------- ### Escape Paths and Strings Source: https://context7.com/ji4n1ng/openinterminal/llms.txt String extensions for escaping special characters in file paths and application names to ensure shell compatibility. ```swift import OpenInTerminalCore // Escape spaces in app names let appName = "Visual Studio Code" let escaped = appName.nameSpaceEscaped() // Returns: "Visual\\ Studio\\ Code" let doubleEscaped = appName.nameSpaceEscaped(2) // Returns: "Visual\\\\ Studio\\\\ Code" // Escape special characters in paths let path = "/Users/user/My Documents/file (1).txt" let escapedPath = path.specialCharEscaped() // Returns: "/Users/user/My\\ Documents/file\\ \\(1\\).txt" // Escapes: space, (), &, |, ;, ", ', <, >, ` // Terminal-safe path escaping let terminalPath = path.terminalPathEscaped() // Returns path with all non-alphanumeric characters (except /) escaped with \\ // URL directory helper var fileURL = URL(fileURLWithPath: "/Users/user/Documents/file.txt") fileURL.getDirectory() // fileURL is now: file:///Users/user/Documents/ ``` -------------------------------- ### Manage Applications with AppManager Source: https://context7.com/ji4n1ng/openinterminal/llms.txt AppManager provides utilities for picking terminals or editors and retrieving application metadata from paths or URLs. ```swift import OpenInTerminalCore let appManager = AppManager.shared // Show terminal picker alert (returns user selection) if let selectedTerminal = appManager.pickTerminalAlert() { print(selectedTerminal.name) // "Terminal", "iTerm", or "Hyper" } // Show editor picker alert if let selectedEditor = appManager.pickEditorAlert() { print(selectedEditor.name) // "Visual Studio Code", "Sublime Text", or "Atom" } // Get application display name from path let name = AppManager.getApplicationName(from: "/Applications/Visual Studio Code.app") // Returns: "Visual Studio Code" (from CFBundleDisplayName or CFBundleName) // Get application name from URL let url = URL(fileURLWithPath: "/Applications/Xcode.app") let xcodeName = AppManager.getApplicationName(from: url) // Returns: "Xcode" // Get application file name (without .app extension) let fileName = AppManager.getApplicationFileName(from: "/Applications/Visual Studio Code.app") // Returns: "Visual Studio Code" // Get application icon let icon = AppManager.getApplicationIcon(from: "/Applications/iTerm.app") // Returns: NSImage of the app icon ``` -------------------------------- ### List Finder Sync Extensions Source: https://github.com/ji4n1ng/openinterminal/blob/master/Resources/README-Config.md Use this command to identify the UUID of the OpenInTerminal Finder extension on macOS 15. ```bash $ pluginkit -mAD -p com.apple.FinderSync -vvv ``` -------------------------------- ### Accessing Supported Applications via SupportedApps Source: https://context7.com/ji4n1ng/openinterminal/llms.txt Use the SupportedApps enum to retrieve lists of supported terminals and editors, or to query specific application metadata and support status. ```swift import OpenInTerminalCore // Supported Terminals let terminals = SupportedApps.terminals // Returns: [.terminal, .iTerm, .hyper, .alacritty, .kitty, .wezterm, .tabby, .warp, .githubDesktop, .fork, .ghostty] // Supported Editors let editors = SupportedApps.editors // Returns: [.textEdit, .xcode, .vscode, .atom, .sublime, .vscodium, .bbedit, ...] // Get app details let vscode = SupportedApps.vscode print(vscode.name) // "Visual Studio Code" print(vscode.bundleId) // "com.microsoft.VSCode" print(vscode.type) // .editor print(vscode.shortName) // "VSCode" // Create App instance from SupportedApps let terminalApp = SupportedApps.terminal.app // App(name: "Terminal", type: .terminal, bundleId: "com.apple.Terminal") // Check if an app is supported let customApp = App(name: "Visual Studio Code", type: .editor) let isSupported = SupportedApps.isSupported(customApp) // true // Check specific app identity let isVSCode = SupportedApps.is(customApp, is: .vscode) // true ``` -------------------------------- ### Configure Neovim Terminal Command Source: https://github.com/ji4n1ng/openinterminal/blob/master/Resources/README-Lite.md Sets the terminal command used when Neovim is selected as the editor. Ensure the path to the nvim binary is correct. ```bash defaults write wang.jianing.app.OpenInEditor-Lite NeovimCommand "open -na Alacritty --args -e /opt/homebrew/bin/nvim PATH" ``` -------------------------------- ### Reset AppleEvents Permissions Source: https://context7.com/ji4n1ng/openinterminal/llms.txt Resets permissions for the OpenInTerminal suite if access was accidentally denied. ```bash tccutil reset AppleEvents wang.jianing.app.OpenInTerminal tccutil reset AppleEvents wang.jianing.app.OpenInTerminal-Lite tccutil reset AppleEvents wang.jianing.app.OpenInEditor-Lite ``` -------------------------------- ### Configure iTerm2 Window Behavior Source: https://context7.com/ji4n1ng/openinterminal/llms.txt Sets whether OpenInTerminal opens in a new tab or a new window. ```bash defaults write com.googlecode.iterm2 OpenFileInNewWindows -bool false # New tab defaults write com.googlecode.iterm2 OpenFileInNewWindows -bool true # New window ``` -------------------------------- ### Reset Default Terminal for OpenInTerminal-Lite Source: https://github.com/ji4n1ng/openinterminal/blob/master/Resources/README-Lite.md Execute this command to clear the current default terminal setting, allowing the selection prompt to reappear upon the next application launch. ```bash # For OpenInTerminal-Lite: defaults remove wang.jianing.app.OpenInTerminal-Lite LiteDefaultTerminal ``` -------------------------------- ### Generate AppleScripts with ScriptManager Source: https://context7.com/ji4n1ng/openinterminal/llms.txt Use ScriptManager to generate AppleScripts for terminal operations and shell commands. Requires importing OpenInTerminalCore. ```swift import OpenInTerminalCore let scriptManager = ScriptManager.shared // Get general script for opening apps via shell command let generalScript = scriptManager.getGeneralScript() /* on openApp(command) tell application "Finder" activate do shell script command end tell end openApp */ // Get script URL for saved scripts if let scriptURL = scriptManager.getScriptURL(with: "generalScript") { // Returns: ~/Library/Application Scripts/wang.jianing.app.OpenInTerminal.OpenInTerminalFinderExtension/generalScript.scpt } // Terminal new tab AppleScript let newTabScript = scriptManager.getTerminalNewTabAppleScript() // Returns AppleScript that opens a new tab in Terminal.app // Generate Terminal cd command let cdCommand = scriptManager.getTerminalNewTabCommand(path: "/Users/user/Documents") // Returns: "cd /Users/user/Documents" // URL-specific new tab script let url = URL(fileURLWithPath: "/Users/user/Projects") let urlScript = scriptManager.getTerminalNewTabAppleScript(url: url) // Returns AppleScript with path-specific cd command // Create AppleScript event for execution let event = scriptManager.getScriptEvent(functionName: "openApp", "open -a Terminal /Users/user") // Returns NSAppleEventDescriptor for script execution ``` -------------------------------- ### Reset AppleEvents permissions Source: https://github.com/ji4n1ng/openinterminal/blob/master/Resources/README-Config.md Use this command to reset permissions if the 'Don't Allow' button was clicked by mistake. ```bash tccutil reset AppleEvents wang.jianing.app.OpenInTerminal ``` -------------------------------- ### Reset OpenInEditor-Lite Default Editor Source: https://github.com/ji4n1ng/openinterminal/blob/master/Resources/README-Lite.md Removes the currently configured default editor for OpenInEditor-Lite. ```bash defaults remove wang.jianing.app.OpenInEditor-Lite LiteDefaultEditor ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.