Im here in search of help because i have been looking all day for this without any results.
I would like to create a script to repeatedly click in a specific location in a windows wich needs to be in the background or minimised, for me to be able to work while the script is clicking in the background window.
I have tried with ControlClick but it doesnt work as intended.
Other possibility could be to hide or make the windows invisible but keep it active.
I would appreciate a lot your help!
Help with a Background script Topic is solved
Re: Help with a Background script
Does the script otherwise work when the window is open but not active in the foreground?
I believe that was my experience with ControlClick, but it may depend on the app being clicked.
I believe that was my experience with ControlClick, but it may depend on the app being clicked.
Re: Help with a Background script
Is a browser windows, and i dont have any script at the moment, but i imagine it may work
Re: Help with a Background script
If that browser is Google Chrome, then give up. There's no way of clicking on a Chrome window unless it's focused.
Your only option is to inject Javascript into the desired page and simulate a click event. But that's not a true click, so depending on the page, that might not work either.
Your only option is to inject Javascript into the desired page and simulate a click event. But that's not a true click, so depending on the page, that might not work either.
Re: Help with a Background script
I may change browsers if that helps, or i may try the javascript, but im clueless about that, how it should be or how may look for it?Getfree wrote: ↑13 Sep 2019, 13:02If that browser is Google Chrome, then give up. There's no way of clicking on a Chrome window unless it's focused.
Your only option is to inject Javascript into the desired page and simulate a click event. But that's not a true click, so depending on the page, that might not work either.
Re: Help with a Background script
Try ControlClick with Internet Explorer, I believe that should work.
Re: Help with a Background script
There's no generic solution for what you want to do.
If you describe in detail what you want to accomplish (instead of how you want to do it), an ad-hoc solution can be found.
If you describe in detail what you want to accomplish (instead of how you want to do it), an ad-hoc solution can be found.
Re: Help with a Background script
May i ask you to give me your discord or something to talk faster? as im new i have to wait till an administrator approves every message
Re: Help with a Background script
Just do a Google search with this text click on page site:autohotkey.com and you'll get lots of examples.
Re: Help with a Background script
May be it would be easier to send clicks to a focused window, and you do your work and stuff on a different desktop.
Read this topic for the different methods of doing that:
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=67844
If you insist in doing the clicks on an unfocused Chrome window, you can use the library chrome.ahk which you can find here:
https://www.autohotkey.com/boards/viewtopic.php?t=42890
Read this topic for the different methods of doing that:
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=67844
If you insist in doing the clicks on an unfocused Chrome window, you can use the library chrome.ahk which you can find here:
https://www.autohotkey.com/boards/viewtopic.php?t=42890
Re: Help with a Background script
You can also find an example of automating Chrome in this thread:
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=67878&p=291797#p291797
And this topic might be useful as well:
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=67871&p=291751#p291751
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=67878&p=291797#p291797
And this topic might be useful as well:
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=67871&p=291751#p291751
Re: Help with a Background script
Here, yet another interesting topic about injecting Javascript into Chrome:
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=67687&p=290936#p290936
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=67687&p=290936#p290936
Re: Help with a Background script
Thats a lot of very useful information, Thankyou. But i think i almost got this
thats my code and now is clicking on the background, the only problem is that clicks in wherever my mouse is in the active window position, so its ignoring my cordinates, any idea of why it could be?
Code: Select all
SetTitleMatchMode, 2
#SingleInstance, Force
#NoEnv
SendMode Input
sug := 0
NumpadDiv::SetTimer, Macro, % (sug := !sug) ? "25" : "Off"
Macro:
ControlClick, x1477 y667, Page,,,, Pos
return
Re: Help with a Background script Topic is solved
There was a reason for saying this:
But wait, you might have heard that Chrome is a multi-process browser, where each tab is a process on its own and that's why it's so stable and crashes on one tab don't affect others and blah, blah, blah...
What exist in different processes are the webpages, not the windows nor the tabs. Each visible page is rendered on a different process and the resulting image is sent to the one thread that owns all windows. That one thread, as it owns all windows, is responsible for handling the input messages sent to all of them. And that thread has one policy: "ALL INPUT GOES TO THE ONE FOCUSED TAB. PERIOD."
Chrome's input system is centralized. All windows belong to a single thread and that thread handles the input to THE active tab in the focused window.
But wait, you might have heard that Chrome is a multi-process browser, where each tab is a process on its own and that's why it's so stable and crashes on one tab don't affect others and blah, blah, blah...
What exist in different processes are the webpages, not the windows nor the tabs. Each visible page is rendered on a different process and the resulting image is sent to the one thread that owns all windows. That one thread, as it owns all windows, is responsible for handling the input messages sent to all of them. And that thread has one policy: "ALL INPUT GOES TO THE ONE FOCUSED TAB. PERIOD."
Re: Help with a Background script
Thankyou for all your answers, i managed to get the solution!, Have a great day
Who is online
Users browsing this forum: No registered users and 329 guests