Issue with "New Google Chrome Window"

Hello -- I am having an issue with opening new Chrome windows. I think I've been having this issue since updating to Ventura 13.0 last week. I have KM 10.2 latest version.

I am running a macro that sets up multiple Chrome windows with various tabs placed in specific spots across two screens. I've been using it for years without issue.

When I have no Chrome windows open, this Action ("New Google Chrome Window") works correctly and creates a new Chrome window at the front. After the first Chrome window is up, this Action creates a new window behind the existing window, which used to not happen. So when the macro goes to paste the new URL from the "New Google Chrome Window," it actually pastes it in the existing Chrome tab of the previous Chrome window. An empty "New Tab" Chrome window is left in its place as the macro starts moving the new windows on my screen to their preset locations. So then I have all (actually most because some are overwritten) of my tabs on one window in the last screen location, and then empty tabs everywhere else.

I put a bandaid on this by using "Type a Keystroke" with "⌘ + N" for now. Can anyone help me identify a setting I can adjust to correct this? Thank you

Hi and welcome to the forum!

The best way to get help quickly is to post your macro by exporting it and dragging it straight to the comment box.

Thank you @noisneil,

I've posted the macro.

IQA Setup.kmmacros (121.6 KB)
image

I don't use Chrome myself but you're in a good position to get some help now. Good luck.

For anyone trying to replicate this issue:

Chrome new windows.kmmacros (2.8 KB)

Whereas the following AppleScript works fine:

tell application "Google Chrome"
	tell (make new window) to open location "https://www.bbc.co.uk"
	tell (make new window) to open location "https://wiki.keyboardmaestro.com/Actions"
end tell

@Nige_S' script works fine but isn't optimized for Google Chrome.

--------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2022/11/10 01:16
# dMod: 2022/11/10 01:16 
# Appl: Google Chrome
# Task: Open a List of URLs With Given Window Bounds.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Google_Chrome, @Open, @List, @URLs
--------------------------------------------------------

set winRecs to {¬
   {"https://wiki.keyboardmaestro.com/Actions", {0, 23, 720, 900}}, ¬
   {"https://www.bbc.co.uk", {720, 23, 1440, 900}} ¬
      }

tell application "Google Chrome"
   repeat with i in winRecs
      set newWin to make new window
      tell newWin
         set URL of its active tab to item 1 of i
         set its bounds to item 2 of i
      end tell
   end repeat
end tell

--------------------------------------------------------

This will be faster than breaking things up into various Keyboard Maestro actions.

You can add more URLs and window bounds to the winRecs variable as needed.


To get the bounds of any given window for adding to the record list run this from Apple's Script Editor.app or better yet Script Debugger. (SD is commercial but reverts to a lite version after a set demo period. The lite version still eats Script Editor.app alive.)

tell application "Google Chrome"
   return bounds of front window
end tell
1 Like

It was a "compare and contrast", not a solution -- the KM macro is a shorter version of @jagal's, showing the reported behaviour without all the extra actions, while the AS works as you'd expect, popping and loading the windows correctly.

1 Like