Hi: I'd love to use KM to automate the process, in Messages, of selecting a message, right-clicking, selecting Delete, then clicking the Delete button to confirm deletion.
Can't seem to get KM to accomplish the last step, I think because the deletion dialog is a modal? Any ideas as to how to handle this?
When I do that manually the Delete button appears already highlighted in the dialog. Why can't you just hit (or have KM strike) the ENTER button of the keyboard?
You might get the button highlighted by pressing tab a couple of times, before pressing Enter. Since it takes only one second to test this, give it a try.
Thx. I'd tried this, but it doesn't work, so i'd thought to target the button by telling KM to move the cursor x pixels from the top left corner of the containing window, but no dice. Is there no way to access a modal window in KM?
Can you post your macro? Select the macro, click the Share button in the toolbar, select Share to Keyboard Maestro Forum. That will open a new topic. Select everything it typed for you and hit Cmd-X to cut. Close the new topic, open this topic, paste.
As far as I know modals are not recognized as windows. If the modal doesn’t open consistently in the same location every time (even after you may have moved it manually) and you can’t use the click “relative to main screen’s corner”, then the only way I’m aware of around this is fairly sophisticated. It involves being familiar with the click actions, and this particular kind of click is HIGHLY not recommended. It’s called “Click at Found Image”, is very powerful, but it has a tendency to bog down KM if too many images are stored, and there is no way to individually view or filter those images once they are added to KM.
NOTE:read Nige_S's comment below before proceeding
Having said that, the process requires grabbing an image that will help you triangulate the location where the click is needed. To do that, click Shift+Command+4, drag the cursor from one corner to the diagonally opposite corner over something that is visually unique, that references the button you want to click. Avoid buttons that could be different (highlighted versus not, changes in the specific text within the button, etc.) when the button appears every time. You don’t even have to use a button at all - if you are using a modal window, I suggest strongly that you use the image in the top center or top left of the modal - you can set the click to be referenced down and to the right of that image. Make sure to not grab anything outside the window in the drag.
Then locate the image in your Screenshots folder, and drag it into the box in the “Move or Click Mouse” action, set to “relative to the;” >>“found images center”
The slider helps to narrow down your unique image if there are other areas that have similar images on the screen - at this point you can just leave it alone. If there are other images that are similar the system may get confused- that’s why you need to keep the “Unique” setting, this way it won’t click anything at all instead of clicking something else by mistake
Then set the “at >” coordinates, start with 100 and 200 and fine tune it from there.
The next problem appears to be that you are using 2 different computers which means you will most likely need to make 2 different macros, grabbing one image for each since the images will be perceived differently by each system (it’s unlikely the screens will have the same ratios and the same resolution settings)
This is a lot for someone trying to learn KM but it shows the depth of this app. Let me know if you have any questions.
Not directly. But a quick test suggests that the modal always appear in the middle of the active Messages window and is always the same size, so you just need to offset your click from the centre-point appropriately.
DO THAT!!
I hadn't tested Messages modals - that's clearly the best solution all around.
Any solution that avoids image grabbing is best - plus it's way easier.
I just know that some apps' modals are moveable, and when reopened sometimes open to that location, but reset to a default location (either screen relative or window relative, per the app) upon restart.
Thx. I tried to do this, but the only thing the system seems to have typed for me is "Delete! Macro (v9.2)", and it doesn't seem to have uploaded anything to the post or forum.
Thx. This certainly seems like the best way to handle this. However, when I run the macro depicted in this attached image, only the initial step, the Move and Right Click, seems to be firing.
I'm not as good as Nige, but I notice you added several actions that may be timing-dependent, so the first thing you should do to check that is put some pauses between each action. If that works, you can try reducing or eliminating the pauses.