Script Runner
Bundledby TypeWhisper
About
The Script Runner plugin pipes transcribed text through any shell command or script. Your text is passed via stdin, and whatever the command writes to stdout becomes the final output. This gives you full flexibility to transform, filter, or enrich transcriptions using standard Unix tools, custom scripts, or any command-line program.
Features
- Run any shell command on transcribed text
- Text flows through stdin/stdout - works with standard Unix pipes
- Environment variables with context (app name, URL, language, profile)
- Configurable timeout to prevent runaway scripts
- Profile filter to limit execution to specific profiles
- Execution log for debugging
Environment Variables
The following environment variables are available to your scripts:
- TYPEWHISPER_APP_NAME - Name of the frontmost application (e.g. “Safari”)
- TYPEWHISPER_BUNDLE_ID - Bundle identifier of the frontmost app (e.g. “com.apple.Safari”)
- TYPEWHISPER_URL - Current URL from the browser, if available
- TYPEWHISPER_LANGUAGE - Language code of the transcription (e.g. “en”)
- TYPEWHISPER_PROFILE - Name of the active TypeWhisper profile
Examples
UPPERCASE - Convert all text to uppercase:
tr '[:lower:]' '[:upper:]'
Sentence Case - Capitalize the first letter of each sentence:
sed 's/\.\s*\([a-z]\)/. \U\1/g; s/^\([a-z]\)/\U\1/'
Search & Replace - Replace specific words or phrases:
sed 's/old/new/g'
Append Timestamp - Add the current date and time at the end:
cat; echo " ($(date '+%Y-%m-%d %H:%M'))"
Remove Filler Words - Strip out common filler words:
sed 's/ \(uhm\|uh\|um\|like\|you know\) / /g; s/ */ /g'
Pipe to Clipboard + Return - Copy text to clipboard and still return it:
tee >(pbcopy)
Custom Script File - Run an external script:
~/scripts/process.sh
Configuration
- Script Command - The shell command to execute. Text is passed via stdin, output is read from stdout.
- Timeout - Maximum execution time in seconds before the script is killed (default: 10s).
- Profile Filter - Optionally limit execution to specific profiles.
Setup
- Open TypeWhisper Settings > Plugins
- Find the Script Runner plugin and click Configure
- Enter your shell command or path to a script
- Optionally set a timeout and profile filter
- Transcriptions will be processed through your script automatically