I am downloading all of my Bank and Credit Card Statements. KM has been very helpful.
I'm now trying to download Discover Credit Card Statements. The site can show 12 months of icons on one page. When I click on one (say, January), it opens a small window that allows me to download and save the statement. When I close that window, the mouse is in a new position, obviously.
Is there a way, to store the last mouse position from the main window, so when I return to it after closing the small window, I can move the mouse up (or down) from that position to go to the next month?
I think the biggest problem is: how is KM supposed to know when you are clicking on one of the month icons? It may be possible, but it's tricky.
A simple solution is don't use the mouse to do the clicking on the month icon. You can easily/manually move the mouse to a month button, then press a hotkey which will trigger a macro which will "remember" the current position of the mouse, then click at the current location, then wait for the next pop-up to appear (which may be solved in different ways) then click on the Save button, then wait for the save to occur, then move the mouse back to the original position.
Depending on the website, this macro could be written in as few as five actions, if you approach the problem as I described above. Are you satisfied with using a hotkey after positioning the mouse?
Thank you all for the suggestions. I may have not been completely clear in my request, but I am going to 'close' the request due to the fact that I've found a work-around: I perform all the mouse clicks in the main window first, and THEN go to the 'sub' window to perform the rest of the task. I was hoping to have some sort of Keyboard Maestro feature to return to the main window where the last mouse click happened. IT currently CAN do this in the main window if the mouse hasn't moved [ "Move and Click at (0,0) from the current mouse position" ]. I may request that feature. Candidly, I'm uncomfortable going to the next level of creating browser scripts etc. I am a long time user of KM, using it for many basic tasks that have saved me "5 Days' time by doing so over the years!
KM has no way of knowing where the "last mouse click" happened -- that isn't something the macOS APIs provide.
It does know where the pointer is "now", via the %CurrentMouse%
token or the MOUSEX()
and MOUSEY()
functions, hence @Airy's suggestion of "put the pointer where you want then run your macro".
Use the CurrentMouse token and the Use Variable action.
The Support Team was quite helpful in this endeavor, as they've alerted me to actions called
"Set Variable Location" and "Use Variable Location" using the Variable %CurrentMouse%. This should solve the challenge of saving the mouse location in a window and having it available when returning to that window.