I have a number of terminal windows open and I want to activate one, i.e. bring it to the front so I can run a command in it. The title of I want to run the command in contains "Simple", at least that's what appears in the title bar of window.
I'm sure I am missing something but "Bring window to front" > "contains Simple" produces an error saying the window was not found.
How do I bring a particular terminal window to the front so I can run a command in it?
Make sure you don't have a non-breaking-space or something instead of a <space> in the window title:
Download and install BBEdit if you don't already have it on your system.
Then get your Terminal window set up and frontmost.
Then run this script from the Applescript Editor:
tell application "Terminal"
set fwName to name of front window
end tell
tell application "BBEdit"
activate
make new document with properties {text:fwName}
end tell
Once you have the name of Terminal's front window in BBEdit type ⌘I to display invisible characters.
See if you have any gray bullet characters or upside-down question mark characters.