osx - Select a particular tab in terminal depending upon the content using applescript and best practices -
this application specific problem. trying find , select tab in terminal.app depending on contents within. here i'm doing:
tell application "terminal" set foundtabs (every tab of every window) contents contains "selectme" repeat possibletab in foundtabs try set selected of possibletab true end try end repeat end tell
this isn't acting expected , pretty foolproof. wonder if can suggest way less code (for instance, looping shouldn't necessary, applescript elusive language).
thanks
thing is, following applescript want, unless "selectme" string unique, find in many tabs. anyway, here go:
tell application "terminal" set allwindows number of windows repeat 1 allwindows set alltabs number of tabs of window repeat j 1 alltabs if contents of tab j of window contains "selectme" set frontmost of window true set selected of tab j of window true end if end repeat end repeat end tell
Comments
Post a Comment