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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -