explaingit

vitorgalvao/custom-alfred-iterm-scripts

3,796AppleScriptAudience · developerComplexity · 1/5Setup · easy

TLDR

A tiny AppleScript that makes Alfred open terminal commands in iTerm2 instead of the default macOS Terminal app, set up in under two minutes by pasting into Alfred preferences.

Mindmap

mindmap
  root((Alfred iTerm2 Script))
    What it does
      Replace default terminal
      Open commands in iTerm2
    Setup
      Paste into Alfred prefs
      Six-step process
    Customization
      Behavior settings at top
      New tab vs new window
    Audience
      Mac developers
      Alfred power users
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Make Alfred open all terminal commands in iTerm2 instead of the default macOS Terminal app.

USE CASE 2

Customize whether Alfred commands open in a new iTerm2 tab or a new window.

Tech stack

AppleScriptAlfrediTerm2

Getting it running

Difficulty · easy Time to first run · 5min
No explicit license stated in the explanation, check the repository for terms.

In plain English

This repository contains a small AppleScript that connects two popular Mac applications: Alfred and iTerm2. Alfred is a productivity launcher for Mac that lets you search files, run commands, and trigger workflows from a keyboard shortcut. iTerm2 is a terminal emulator that many developers prefer over the Mac's built-in Terminal app. Alfred has a built-in feature that lets you open terminal commands from its interface, but by default it opens the standard Terminal app. This script replaces that default behavior so Alfred opens commands in iTerm2 instead. Setup involves copying the script text and pasting it into a specific field in Alfred's preferences, which takes a minute or two. The README is short because the process is straightforward: there are six steps, and the script handles the rest. A few customizable settings at the top of the script let you adjust the exact behavior if the defaults do not suit your workflow.

Copy-paste prompts

Prompt 1
How do I paste the custom iTerm2 AppleScript into Alfred so it opens my commands in iTerm2 instead of Terminal.app?
Prompt 2
How do I change the Alfred iTerm2 script to open commands in a new tab rather than a new window?
Prompt 3
My Alfred iTerm2 script stopped working after updating iTerm2 or Alfred. How do I troubleshoot it?
Open on GitHub → Explain another repo

← vitorgalvao on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.