Choosing Popup Menu in Family Tree Maker

I'm using FamilyTree Maker 2019 and would like to use a feature only available when using a right-click to open a popup menu.

I want to trigger the macro If a record in the listing of documents is already highlighted. I don't want to de-select the already selected record, otherwise I would have to have a macro for each record position on the screen. As a result the Mouse move and click option does not seem to fit the solution to the problem.

Is there a way to call the Pop Up Menu without relying on a specific mouse location?

Do you mean, a file is highlighted in a list, but the mouse pointer is somewhere else on screen? And you still want to invoke the right-click menu for that item without moving the mouse over the highlighted list item?

Or are you saying that you have to move the mouse away from the highlighted file and right-click at another place on the screen?

A screen grab of what you are seeing might help.

Generally a right-click on something doesn't change the current selection, and KM can record the pointer position and and then restore it later -- so if you can do what you want manually you should be able to do it with a macro.

There are ways of doing what you want without moving the pointer by using UI Scripting via AppleScript, but they do depend on the software making certain Accessibility features available.

To your first question, yes that is correct. Otherwise I would have to have a mouse position for each record in the list.

For your second question, I'm hoping to avoid moving the cursor, as the popup menu is geographically limited in fuction when it is located in the Individual & Shared Facts region of the screen.

I have included ascreen shot of the portion of the screen that relates to the Popup function.

The popup menue when triggered.

Thanks for the informnation on calling the Popup menu not changing the selection, so that mightchange how I'm thinking about the problem.

FamilyTree Maker does does not contain an Applscript dictionary or any support for AppleScript.

Okay. To invoke a right-click menu of an item on the Mac, the mouse has to be over the item. However, as @Nige_S says, you can save the current mouse position and return to it instantly, in effect not moving the mouse over the highlighted item.

One way to get the mouse temporarily over a highlighted item is to use "click at found image" where the found image is an area screenshot of the highlight colour.

image

Once the menu is invoked you can select items in it by using Keyboard Maestro to type a part of their name, or using arrow keys. Once the item is selected, getting Keyboard Maestro to type the Return key will action it.

Here is an example that works in the Finder, to select the context menu item "Rename". You would need to replace the blue highlight image by pasting in an area screenshot of your actual highlight colour into the image well in the Action. And change the typed letters to the menu choice you want.

When testing a Macro that does this, it is a good idea to test it in stages to make sure it is selecting the correct menu items. Putting temporary long pauses between Actions gives you a chance to see what it going on. If it all works correctly you can remove or reduce the pauses.

In the GIF you can see that I highlight the item in Finder, move the mouse away and then run the Macro. The mouse pointer stays where it is, away from the highlighted item. But the item "Rename" is selected in the Menu. I disabled the last action (hitting return) so that you can see that the "Rename" item on the context menu is selected. As you can see, the whole process it almost instantaneous.
.
Screen Recording 2022-10-01 at 16.30.09-Animated GIF

EXAMPLE Call Context Menu For HIghlighted Item.kmmacros (27.3 KB)

One other thing. To be able to use keys to navigate around these menus you need to go to the Mac's System Preferences/Keyboard/Shortcuts and make sure this it checked: "Use keyboard navigation to move focus between controls"