I (believe) I understand basic window management in CB but am not sure how to set predefined locations for new windows opening from clicking on links. As in command clicking a link in safari and opening it on an external monitor's top half of screen etc.. Sorry if this is too basic but I am quite new and have not been able to find any threads on this.
KM?
Unless anyone has any clever ideas, which is always possible here, you might have to just open the window and then move it.
You can use the Move a window
action for that.
See Manipulate a Window Action in the Wiki for more, and of course ask further here as you need to.
Can the Manipulate Window action move a window to a different monitor? If not, they'll probably need Select or Show a Menu Item
as well. Not sure what kind of trigger would be ideal though.
Yes.
Thank you both so much hemicyon and kevinb. Also yes and thank you for the clarification kevinb (I did mean KM). I have an avenue to go down now.
You'll have to set the device key trigger (click the trigger's "key" field and press your mouse button again) and it does rely on your mouse/trackpad being treated as a USB device (so only works with eg a Magic Trackpad when it is connected via a cable), but try this:
Comm-Click Link to Other Screen.kmmacros (4.3 KB)
Even if the trigger isn't compatible with your pointing device there's a couple of things you can use when doing your own version:
- You need to wait for the new window to appear before you can manipulate it, which we're doing by pausing until the number of Safari windows changes
- You can reference your external display with the
External
parameter when getting screen coordinates - Your new window isn't the frontmost (unless you also hold down ⌥ when clicking), so you have to manipulate the second window in the stacking order (index
2
)
If you do ⌃⌥⌘-click you'll move the window you clicked on, not the new one, so if that's going to be a problem you'll want to add a check for the ⌥ key being down and handle it appropriately