Hello everybody.
First let me introduce myself: my name is Matteo and I write from Italy.
Sorry for my bad English too.
I'm trying to understand the KM program and I'll explain immediately what I need: I have this screen in google chrome and I have to make sure to associate the mouse click for each blue box to some keys on the keyboard (in this case 5 keys) where it says "COMPRA". Initially I used the move or click mouse action with the coordinates, but the blue box are not always at the same point (this is due to how many lines there are in the description on the left) and this does so that the click does not match.
i'm trying to do it with the found image, but i'm really having trouble selecting the search area. If I select the search in the all screen, I can find all 5 blue boxes, but if I search in the specific area I never succeed (surely I am wrong to enter the various coordinates where to search).
Now I would like to ask you if I should continue to set the macro in this sense or if it is possible to associate the position of the found images using a variable and then click.
Sorry if maybe these are trivial questions, but programming is not my job.
Hi @Mfin,
Welcome.
You may not need clock at f found image.
Try click browser link.
https://wiki.keyboardmaestro.com/actions/Click_Browser_Link
Thanks for the advice. Actually it could be a solution, but I don't know how to classify the various "compra subito". I attach the screenshot. I see this by clicking "inspect" in google chrome of the third compra subito.
Thank you.
I think what you are trying to do is probably better to be accomplished by a manual mouse click.
If I understand correctly, you may click any of the compare price button. Keyboard Maestro will never know which button is intended unless you tell it. So, even if you can get a list all of the buttons .btn button-primary
in this case, you will need to tell KM which one is intended. If you always want to click a unique button, or the first button/last button of the same kind, this is doable with JavaScript. But if you want to click potentially any button, then you need to have another action to tell Keyboard Maestro which button is intended. It is better, then, as I said, to click the button manually.
Hi Martin, thanks for the reply.
I'll explain in a few words.
As you will have understood what I have linked is an online car auction site. At a specific time the auction starts and if the price is convenient, I have to make sure to click as quickly as possible on one of the four buttons with the words"COMPRA SUBITO" (buy now). my idea is to associate those four buttons with four hot keys of the keyboards, so you can choose which of the four cars to buy (unfortunately I don't know before the auction starts at what price they will come out). At first I created a macro with the action move and click mouse, but unfortunately it could be happens that the buttons with the text "buy now" are offset due to the number of lines in the car description.
so now I have to look for another way.
i'm also trying to do it with the found and click image, but i'm really having trouble selecting the search area. If I select the search in the all screen, I can find all 4 blue boxes with "buy now", but if I search in the specific area I never succeed (surely I am wrong to enter the various coordinates where to search).
It's always better to offer more information so that others can better help you out. The time sensitive need is an essential piece of information to opt for a macro. The plan to assign different triggers for different buttons is also essential information.
Is the website publicly accessible? If so, please post the link so that others can test when they try to help you.
Hi Martin and thanks again for your continued help. It seems that I have finally managed to fix the button issue thanks to the action click at found image. I managed to figure out how to set the coordinates where to look for the buy now image and doing various experiments it is always working for me even if the description lines of the various cars are staggered.
It should now synchronize with the auction site's server time. the site is https://www.aldcarmarket.com/en-it/.
Since auctions always start at a specific time (for example 4 p.m.)
so far I have used the Auto Refresh Plus chrome extension to refresh the page.
But it has happened to me a few times that the refresh starts a few milliseconds before the auction starts and makes me waste time to do a further manual refresh with the possibility that someone else steals the car I wanted to buy. is there the possibility to synchronize the starting time of the macro with the site in question?or is there a more practical solution?
Thanks so much.
I'm glad you've found a solution.
One way I can think of is to pause a few milliseconds before the initial refresh.
Another way is to check if a certain element exists:
If the element exists, move forward. If not, refresh the page.