MichaelCrawley Posted March 21, 2023 Posted March 21, 2023 I am curious how I would go about setting chrome or any browser to Full Screen and even setting the zoom level - I am more curious how I can go about doing it. There is a lot more going on in my small gui but I think this get the jist of what I am wanting to do. But I am not sure hoe yo ho about it. I did look for a UDF and I could not find one that I could use but I am kind of new to AUTOIT so I may have been over looking stuff. ;function to open webpage I did remove my company web page Func webPage2() Run ('"C:\Program Files\Google\Chrome\Application\chrome.exe" https://www.google.com') Sleep(5000) EndFunc ;cases for EQCDM1 Case $idButton_QCDM1 webPage2() WinSetState("Not the actual title of the page", "", @SW_MAXIMIZE)
Solution Danp2 Posted March 21, 2023 Solution Posted March 21, 2023 To start Chrome maximized, try adding the command line switch "--start-maximized" to the end of your Run command, ie: Run ('"C:\Program Files\Google\Chrome\Application\chrome.exe" https://www.google.com --start-maximized') Latest Webdriver UDF Release Webdriver Wiki FAQs
MichaelCrawley Posted March 21, 2023 Author Posted March 21, 2023 @danp So I used your idea and "--start-fullscreen" and this worked.... thanks for the help!
MichaelCrawley Posted March 21, 2023 Author Posted March 21, 2023 I'm going to research some more but Is there an option to set the zoom level?
Werty Posted March 21, 2023 Posted March 21, 2023 You could send a Left control down and scroll the mousewheel, then control up again. This works for me when chrome window is active... #include <AutoItConstants.au3> Send("{LCTRL down}") MouseWheel($MOUSE_WHEEL_UP, 3) Send("{LCTRL up}")l Some guy's script + some other guy's script = my script!
MichaelCrawley Posted March 21, 2023 Author Posted March 21, 2023 I reall new to AutoIT and have taken some online lessons watched a lot of YouTube videos but I am not a programmer I am reasonably good scripting this a new world for me. @werth thanks for the info... these devices do not have keyboards or a mouse they are display only. I can RDP to them and a push a scipt but I am trying to get eveything self conatined. I use another tool at my current company and I was able use something like this --force-device-scale-factor=.86. I did try it using that code but I dont think that --force-device-scale-factor is native to AutoIT so I didn't put forth much of an effort. The actual is script using a different tool is: start "Title of Page" "C:\Program Files\Google\Chrome\Application\chrome.exe" --start-fullscreen --new-window "Web Page" --force-device-scale-factor=.86
Danp2 Posted March 21, 2023 Posted March 21, 2023 Did you try it like this? Run ('"C:\Program Files\Google\Chrome\Application\chrome.exe" https://www.google.com --start-fullscreen --force-device-scale-factor=.86') Latest Webdriver UDF Release Webdriver Wiki FAQs
MichaelCrawley Posted March 21, 2023 Author Posted March 21, 2023 @Danp2 yes that what I went with first. here is my code I tried. The default is 175% which is odd to me they are internal pages I don't know I should include that actual pages or not and they are not going to 86% ;functions to open webpages Func webPage2() Run ('"C:\Program Files\Google\Chrome\Application\chrome.exe" GoogleSheets Page --start-fullscreen --force-device-scale-factor=.86') Sleep(5000) EndFunc Func webPage1() Run ('"C:\Program Files\Google\Chrome\Application\chrome.exe" GoogleSheets pages --start-fullscreen --force-device-scale-factor=.86') ;Sleep(1000) EndFunc ;==> open webpages
Danp2 Posted March 21, 2023 Posted March 21, 2023 If it worked with your other tool, then it should also work with AutoIt. What happens when you manually run the command from your RDP session? Latest Webdriver UDF Release Webdriver Wiki FAQs
MichaelCrawley Posted March 22, 2023 Author Posted March 22, 2023 We use cmdow.exe make active windows do things you can script what screen opens, and where it opens, and the zoom level etc. You cannot make a GUI with cmdow.exe though. In theory I could create a GUI in AUTOIT to point to the specifcs scripts but I am trying to get away from that. I would like to allow user to click a button to open a web page (google sheets) or to close chrome or to open and close excel. These tools rarely change they stay in place as long as the part is being produced. So a small GUI works well for this appllicatiion.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now