getsenic / nuimo-app-osx-actions

16 stars 6 forks source link

Check if there is any open window before opening a tab #17

Closed hansmbakker closed 8 years ago

hansmbakker commented 8 years ago

The old version did not check if there was any open Chrome window. If there was no open window then "new tab" wouldn't work.

larsblumberg commented 8 years ago

Nice! Can you please simplify to:

tell application "Google Chrome"
    if (count of windows) is 0 then
        make new window
    else
        make new tab at end of tabs of window 1
    end if
end tell

Thanks!

hansmbakker commented 8 years ago

Done :)