You don’t need to remap a key to menu item specifically; remap it to a null value or another key. To do this, use  the `hidutil` command to remap <kbd>F9</kbd> to a null value, backspace, or something else.

```
hidutil property --set '{"un
[{\"HIDKeyboardModifierMappingSrc":0x700000045, \
"HIDKeyboardModifierMappingDst":0x700000000}]}}

```

Now, the source (hex) value of <kbd>F12</kbd> is 0x700000067 and the destination value is 0x700000000.  I haven't tested this particular value but, should it not work, you can use 0x70000002A or 0x7000000E6 for a second backspace (it’s the key you intended to hit anyway), or something like right <kbd>⌥ Option</kbd> respectively. 

This solution is based on [this answer][1] I previously wrote for a similar question.




  [1]: https://apple.stackexchange.com/a/455274/119271