// Examples of how to call the script. "Select Tab By Name" Global $G_TAB_NAME = Input('Select Tab By Name...', 'Name of the tab to select?', 'TabName'); Sub '_checkBothPanes'; "Select Tab By Name (In Active Pane Only)" Global $G_TAB_NAME = Input('Select Tab By Name...', 'Name of the tab to select?', 'TabName'); Sub '_checkActivePane'; //------------------------------------------------------------------------------ // Checks the active pane for a named tab... // If not found, activates and searches the inactive pane. // If still not found, returns the user to the original pane. "_checkBothPanes" // Ensure we have a query. Global $G_TAB_NAME; End ! $G_TAB_NAME, 'Global variable $G_TAB_NAME not defined!'; Global $G_CHECKING_BOTH_PANES = true; // Check active pane. Sub '_checkActivePane'; Status 'Checking inactive pane...',, 'progress'; // Try inactive pane. Focus 'PI'; Sub '_checkActivePane'; // Return to original pane. Focus 'PI'; Status "No tab named '$G_TAB_NAME' found!",, 'alert'; Sound 'SystemHand'; // Checks for a tab with matching name in the active pane. "_checkActivePane" // Ensure we have a query. Global $G_TAB_NAME, $G_CHECKING_BOTH_PANES; End ! $G_TAB_NAME, 'Global variable $G_TAB_NAME not defined!'; // Enumerate over all tabs searching for a match. $i = 1; $tCount = Tab('Get', 'Count'); while ($i <= $tCount) { $tName = Tab('Get', 'Name', $i); // If found select tab and exit. if ($tName LikeI $G_TAB_NAME) { SelTab $i; Status 'Tab found!',, 'ready'; Sound 'SystemExit'; End true; } $i++; } // If only checking active pane display an alert at the end. if (! $G_CHECKING_BOTH_PANES) { Status "No tab named '$G_TAB_NAME' found in this pane!",, 'alert'; Sound 'SystemHand'; }