The scenario is to conduct a search on 6 different websites with the same keyword, and open them side-by-side in a new window each for quick comparison.
Will anyone know how to open them "equally"?
How to open 6 Chrome Windows side-by-side equally?
-
- Posts: 314
- Joined: 13 Dec 2015, 20:48
Re: How to open 6 Chrome Windows side-by-side equally?
Here's an example script. You might have to change the path to your chrome.exe file. And of course change the keywords and the URL to your site. It appears that it won't let me resize Chrome to less than 500 in width, so you might get overlapping windows depending on your monitor resolution.
Code: Select all
Keywords := ["Click", "FileRead", "Gui", "MsgBox", "Loop", "Send"]
Gui, +ToolWindow -Caption
Gui, Color, Yellow
Gui, Font, s16
Gui, Add, Text, w300 Center, Loading Chrome windows...
SysGet, Mon, MonitorWorkArea, 1
W := (MonRight - MonLeft) / 6
T := MonTop
B := MonBottom
for i, Keyword in Keywords
{
Gui, Show ; allows us to wait for Chrome to be the new active window
Sleep, 200
Run, C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --new-window https://www.autohotkey.com/docs/commands/%Keyword%.htm
WinWaitActive, ahk_exe chrome.exe
WinMove, ahk_exe chrome.exe,, (i - 1) * W, T, W, B - T
}
ExitApp
Re: How to open 6 Chrome Windows side-by-side equally?
https://www.howtogeek.com/181681/4-hidden-window-management-tricks-on-the-windows-desktop/
(I'd guess the OP is going for that view ...??)
Btw, I seem to remember that I've seen the foto of that article's author somewhere here at this forum
(I'd guess the OP is going for that view ...??)
concept
Btw, I seem to remember that I've seen the foto of that article's author somewhere here at this forum
-
- Posts: 314
- Joined: 13 Dec 2015, 20:48
Re: How to open 6 Chrome Windows side-by-side equally?
Yes Bobo - you're right. Looking to tile them neatly without overlapping and maximizing all available screen estate on my 1440p monitor.
Re: How to open 6 Chrome Windows side-by-side equally?
So, if Windows isn't providing that option already (but I think so, check out the linked article) you can mix up the code I've provided above with boilers'.
Good luck.
Good luck.
Re: How to open 6 Chrome Windows side-by-side equally?
This mod to my code does it:
Code: Select all
Keywords := ["Click", "FileRead", "Gui", "MsgBox", "Loop", "Send"]
Gui, +ToolWindow -Caption
Gui, Color, Yellow
Gui, Font, s16
Gui, Add, Text, w300 Center, Loading Chrome windows...
SysGet, Mon, MonitorWorkArea, 1
W := (MonRight - MonLeft) / 3
H := (MonBottom - MonTop) / 2
T := MonTop
for i, Keyword in Keywords
{
Gui, Show ; allows us to wait for Chrome to be the new active window
Sleep, 200
Run, C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --new-window https://www.autohotkey.com/docs/commands/%Keyword%.htm
WinWaitActive, ahk_exe chrome.exe
WinMove, ahk_exe chrome.exe,, (i < 4 ? W * (i - 1) : W * (i - 4)), (i < 4 ? T : T + H), W, H
}
ExitApp
-
- Posts: 314
- Joined: 13 Dec 2015, 20:48
Re: How to open 6 Chrome Windows side-by-side equally?
Hello boiler,
Thanks for the attempt. There's a bit of misunderstanding here. What I meant was I wanted to loop 6 different websites with the same keyword, aka
www.abc.com/%keyword%.html
www.def.com/%keyword%.html
etc
and tile them eventually. How do I reverse the logic in your code? On my side, the code also doesn't tile the 6 windows, nor does it ask for input on the keyword.
Thanks for the attempt. There's a bit of misunderstanding here. What I meant was I wanted to loop 6 different websites with the same keyword, aka
www.abc.com/%keyword%.html
www.def.com/%keyword%.html
etc
and tile them eventually. How do I reverse the logic in your code? On my side, the code also doesn't tile the 6 windows, nor does it ask for input on the keyword.
Re: How to open 6 Chrome Windows side-by-side equally?
Sorry. You explained it correctly, and I read it wrong. It could easily be changed to put the websites in the array. However, the format for searching for keywords on various websites isn’t usually (ever?) just www.abc.com/%keyword%.html, so you will need the array to have the proper format with some stand_in for the keyword so it can be replaced (the word keyword itself would work). Do you have the search format for various websites?
It’s very simple to add an InputBox to ask for the keyword. It doesn’t ask for the keyword because it was coded to search for an array of keywords. Once it’s coded for an array of websites, having it ask for the keyword is trivial.
I’m not sure why it’s not opening the windows tiled. Are you using multiple monitors? What does it display when you run the following?
It’s very simple to add an InputBox to ask for the keyword. It doesn’t ask for the keyword because it was coded to search for an array of keywords. Once it’s coded for an array of websites, having it ask for the keyword is trivial.
I’m not sure why it’s not opening the windows tiled. Are you using multiple monitors? What does it display when you run the following?
Code: Select all
SysGet, Mon, MonitorWorkArea, 1
MsgBox, % "L: " MonLeft "`nR:" MonRight "`nT: " MonTop "`nB:" MonBottom
-
- Posts: 314
- Joined: 13 Dec 2015, 20:48
Re: How to open 6 Chrome Windows side-by-side equally?
Code: Select all
R:2482
8:1440
Re: How to open 6 Chrome Windows side-by-side equally?
So the other two values you didn’t report were both 0, right?
When you say it didn’t tile them, did it open 6 chrome windows? Did it resize or move them at all? You might try running the script as administrator to see if it helps.
When you say it didn’t tile them, did it open 6 chrome windows? Did it resize or move them at all? You might try running the script as administrator to see if it helps.
-
- Posts: 314
- Joined: 13 Dec 2015, 20:48
Re: How to open 6 Chrome Windows side-by-side equally?
Hmm I only show what popped up, that's all I got.
Yes it opened 6 chrome windows, but no resizing/moving was done. Run as admin gave same results.
Re: How to open 6 Chrome Windows side-by-side equally?
It should have at least shown the other letters. Can you copy and paste the actual MsgBox results? When the MsgBox is active, press Ctrl+C, and it will copy the text of the MsgBox which you can paste here.
It’s weird that nothing is showing for those other variables. That’s why it’s messing up the WinMove. We can fix that, but I still would like to see the actual output to try to figure out why it’s acting different for you.
It’s weird that nothing is showing for those other variables. That’s why it’s messing up the WinMove. We can fix that, but I still would like to see the actual output to try to figure out why it’s acting different for you.
-
- Posts: 314
- Joined: 13 Dec 2015, 20:48
Re: How to open 6 Chrome Windows side-by-side equally?
this is exactly what I got..
Re: How to open 6 Chrome Windows side-by-side equally?
Why did you not report the other stuff, even after I said it looked like the parts with the zeros was missing? When I asked “So the other two values you didn’t report were both 0, right? ”, you replied, “Hmm I only show what popped up, that's all I got.” Please put at least as much effort into answering my questions as I am in trying to help you.
Given those results, it should have worked. Are you using the full script that opens the 6 windows as I posted it without modifications? For example, the GUI it shows is important for how it operates. It’s not just for show. Or have you modified it in some way?
Given those results, it should have worked. Are you using the full script that opens the 6 windows as I posted it without modifications? For example, the GUI it shows is important for how it operates. It’s not just for show. Or have you modified it in some way?
-
- Posts: 314
- Joined: 13 Dec 2015, 20:48
Re: How to open 6 Chrome Windows side-by-side equally?
Just to clarify, there are times when the 0 values show and when it doesn't show. The first time I reported, it was as-is. Hope you understand.boiler wrote: ↑07 Jul 2020, 20:24Why did you not report the other stuff, even after I said it looked like the parts with the zeros was missing? When I asked “So the other two values you didn’t report were both 0, right? ”, you replied, “Hmm I only show what popped up, that's all I got.” Please put at least as much effort into answering my questions as I am in trying to help you.
Given those results, it should have worked. Are you using the full script that opens the 6 windows as I posted it without modifications? For example, the GUI it shows is important for how it operates. It’s not just for show. Or have you modified it in some way?
Yes I pasted it verbatim to test.
Re: How to open 6 Chrome Windows side-by-side equally?
I don't know why those variables from SysGet wouldn't always be populated. You could try this version of the script that doesn't rely on those two variables being 0. If this produces 6 tiled windows, then I can show how to change it for 6 different search windows using one user-defined keyword.
Code: Select all
Keywords := ["Click", "FileRead", "Gui", "MsgBox", "Loop", "Send"]
Gui, +ToolWindow -Caption
Gui, Color, Yellow
Gui, Font, s16
Gui, Add, Text, w300 Center, Loading Chrome windows...
SysGet, Mon, MonitorWorkArea, 1
W := MonRight / 3
H := MonBottom / 2
T := 0
for i, Keyword in Keywords
{
Gui, Show ; allows us to wait for Chrome to be the new active window
Sleep, 200
Run, C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --new-window https://www.autohotkey.com/docs/commands/%Keyword%.htm
WinWaitActive, ahk_exe chrome.exe
WinMove, ahk_exe chrome.exe,, (i < 4 ? W * (i - 1) : W * (i - 4)), (i < 4 ? T : T + H), W, H
}
ExitApp
-
- Posts: 314
- Joined: 13 Dec 2015, 20:48
Re: How to open 6 Chrome Windows side-by-side equally?
yup, now it works. just 1 small issue - there are blank margins around every windows. Is it possible to eliminate the margins?
Also, I tested it a few times and occasionally, the 5th window will be missed out.
Lastly, as it is tiled into 6 windows, is it possible to set a custom zoom level (E.g. 70%) for each window based on the URL?
https://i.imgur.com/rlPospO.png
Also, I tested it a few times and occasionally, the 5th window will be missed out.
Lastly, as it is tiled into 6 windows, is it possible to set a custom zoom level (E.g. 70%) for each window based on the URL?
https://i.imgur.com/rlPospO.png
Re: How to open 6 Chrome Windows side-by-side equally?
For some reason, when they introduced Windows 10 they really messed up the difference between the visible edges of windows and the virtual edges. So try this version which adds some extra size to the width and height of each window:reverberation wrote: ↑ there are blank margins around every windows. Is it possible to eliminate the margins?
Code: Select all
Keywords := ["Click", "FileRead", "Gui", "MsgBox", "Loop", "Send"]
Gui, +ToolWindow -Caption
Gui, Color, Yellow
Gui, Font, s16
Gui, Add, Text, w300 Center, Loading Chrome windows...
SysGet, Mon, MonitorWorkArea, 1
W := MonRight / 3
H := MonBottom / 2
T := 0
for i, Keyword in Keywords
{
Gui, Show ; allows us to wait for Chrome to be the new active window
Sleep, 200
Run, C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --new-window https://www.autohotkey.com/docs/commands/%Keyword%.htm
WinWaitActive, ahk_exe chrome.exe
WinMove, ahk_exe chrome.exe,, (i < 4 ? W * (i - 1) : W * (i - 4)), (i < 4 ? T : T + H), W + 18, H + 9
}
ExitApp
Hmm...When that happens, does it not open the 5th window at all, or does it open it but not resize it?reverberation wrote: ↑ Also, I tested it a few times and occasionally, the 5th window will be missed out.
We could put something in the array of URLs to indicate the zoom factor to use and then adjust it by sending Ctrl+- the appropriate number of times. It looks like factors are 90%, 80%, 75%, 67% (and smaller), so you could choose how many steps smaller (or larger) than 100% you want each one to be.reverberation wrote: ↑ Lastly, as it is tiled into 6 windows, is it possible to set a custom zoom level (E.g. 70%) for each window based on the URL?
-
- Posts: 314
- Joined: 13 Dec 2015, 20:48
Re: How to open 6 Chrome Windows side-by-side equally?
hmm there's some overlapping of windows in the new script.
the 5th window is not opened at all.
is there a way to set a specific zoom % instead of using Control + / - ?
the 5th window is not opened at all.
is there a way to set a specific zoom % instead of using Control + / - ?
Re: How to open 6 Chrome Windows side-by-side equally?
Seeing the margin to the right of the screen (while missing to the left, https://i.imgur.com/rlPospO.png) gives me the idea that you should have a look if your (hardware) visible screen adjustments are in a leveled position? JFTR.
Who is online
Users browsing this forum: Joey5 and 257 guests