In my workflow, I work with two to three windows next to each other.
I'd like to hold down modifier keys while pressing on a link. If I press in the lower left corner on the touchpad, it should open in the left active Chrome window, if I press lower middle it should open in the middle window and if I press in the lower right corner it should open in the right positioned window.
(would be great if it could open new window if there are no windows open).
Maybe it could be based on snap areas which I already have setup or maybe by window name (you can name windows in Chrome) but this might be broken if you close the window and open a new one.
Anyway, does anyone have an idea on how this can be achieved?
UPDATE: I found a way to do it. Not as clean as I wanted but it works.
- Name your window eg. "Third"
- Create a trigger eg. hold Option + three finger tap
- Assign it "Trigger context menu item" with trigger command
Copy Link Address
- Attach additional action to run Applescript (async in background)
tell application "Google Chrome"
set theURL to the clipboard
set found to false
set targetWindow to missing value
-- Loop through windows to find one named "Third"
repeat with w in windows
if (title of w as string) is equal to "Third" then
set found to true
set targetWindow to w
exit repeat
end if
end repeat
-- If the "Third" window is found, create a new tab with the copied URL
if found then
tell targetWindow
set newTab to make new tab with properties {URL:theURL}
set active tab index to index of newTab
end tell
else
-- If not found, create a new window and name it "Third" if possible
set targetWindow to make new window
tell targetWindow
set newTab to make new tab with properties {URL:theURL}
set active tab index to index of newTab
end tell
-- Note: Directly naming windows in Chrome via AppleScript might not be supported.
-- This script assumes the new window can be implicitly considered "Third" by the user.
end if
activate
end tell