diff --git a/Commands/Open directory in Terminal.plist b/Commands/Open directory in Terminal.plist index a7ce075..b2a6ff7 100644 --- a/Commands/Open directory in Terminal.plist +++ b/Commands/Open directory in Terminal.plist @@ -32,7 +32,7 @@ def terminal_script_new_tab(dir) return <<-APPLESCRIPT tell application "Terminal" activate - set originalContent to contents of tab in window 1 + set numberOfTabs to count tabs in window 1 tell application "System Events" repeat while "Terminal" is not name of (process 1 where frontmost is true) delay 0.1 @@ -40,9 +40,9 @@ def terminal_script_new_tab(dir) tell process "Terminal" to keystroke "t" using command down end tell set startedAt to current date - repeat while (contents of tab in window 1) is originalContent + repeat while (count tabs in window 1) is numberOfTabs delay 0.1 - if (current date) - startedAt > 2 then + if (current date) - startedAt > 2 then error "Could not open new tab" end if end repeat