Record function and changing window sizes

Even though I have had a license for a while, I have been a light user of KM most of the time and so I'm quite a newby when it comes to the more advanced functions. The question I have is very simple and I'm sure there might be answers in the forum. Alas, I have not been able to find help for this.

OK, the problem I'm having is the following. I want to automatize a task with an application called Tinderbox. In Tinderbox you can add some attribute called KeyWord to associate it to a particular note. There is no way to do this through the menu. The only way to do it is to click on a little button on the upper right corner of the window with the mouse and then go through a couple of steps where you have to choose (always with the mouse) among different options.

I built a macro that involved activating the application, bringing it to the front and then ... well then, I used the 'record' function to record all the steps I take with the mouse in order to open the window where I can introduce the new keyword.

Obviously, the problem is that if I resize the application window (and I have to do this often), the coordinates for the location of the button using the mouse change and the macro stops working.

So the question is, what does one do to overcome this problem? One option would be to introduce an action that makes the window be of the appropriate size so that in the subsequent recorded action the cursor of the mouse finds the button in the relevant location. This seems a very cumbersome and counterintuitive way to do this and, besides, I don't know how one would do that.

I'm pretty sure this problem has a very simple solution for advanced users but I'm stumped. I've looked through the manual and I haven't been able to find any pointers to a possible solution.

Any help with this would be greatly appreciated.

Josep M.

Hey Josep,

Are you having KM click the mouse relative to the entire screen, or only to the front window of Tinderbox? If it's currently the former, I would set it to be relative to the upper right corner of the front window and then set the click coordinates anew with that action's "Get" button:

52 PM

It sounds like another viable option would be to use the mouse click action with "Click relative to the found image's center" and use screenshots of every element you need to click:

54 PM

Between these two options, I would think there should be a way to keep using this macro regardless of the window's current size and location.

Thanks very much for the prompt response gglick! I think I've learnt something new but I'm afraid this wasn't the solution.

It turns out that I already had KM with the mouse relative to the front window's upper right corner. But this doesn't seem to work. I don't know whether this is an issue but the button I need to click is not exactly in the upper right corner (see the image for the lowest of all the '+' signs).

Anyway, I tried the image option and something seems to be working because KM seems to find the right '+' sign. The problem is that the mouse simulation doesn't seem to be really clicking on the button. When I turn the Display option on, I can see that the button is highlighted in green but then, the stuff that needs to be typed in to activate the right attribute is not typed within the little window that opens up when you click on this button with the mouse but rather in the Tinderbox text area.

I don't know whether I'm explaining myself well. It is hard to figure out what I'm doing if you are not familiar with Tinderbox.

At any rate, I'm not getting the expected results.

Josep M.

No problem, Josep. However, I'm afraid that your suspicions are correct, as I am not familiar with Tinderbox and don't understand exactly the issues you're facing. If you could provide more screenshots of the kind of window you're dealing with and the actions you would like the macro to perform, and also upload your current version of the macro so we can see exactly how you have it set up, we should be able to offer better help.

Hey Josep,

Is that button always in the same relative position to the top-right-corner?

If so then change the click action to MOVE, so the cursor is moved but no click is sent.

Then adjust the x and y boxes in the click action, run the macro and see where the cursor ends up.

Keep adjusting as necessary until you're over the button, and then change move back to click.

Give that a try and report back.

-Chris

1 Like

Thanks guys! In the end I followed ccstone's suggestion and it worked. For some reason, with the record function, the cursor wound up positioned in the wrong area of the screen. I followed ccstones instructions and through trial and error I managed to position the cursor on the right spot and now everthing is working perfectly.

Josep M.

1 Like