Selection of Menu Item disabled in Safari

KM newbie: Trying to write a simple macro to open a new Safari front browser window (fine), then Select Menu Item (View, Translation, Translate to English)
The following action results in an error message:


Errror message:
image
I can think of no reason why the activated Safari is not in a state where it would work. Has Apple blocked that command from automation somehow?
Please advise. Thank you!
Automation is enabled for KM
Javascript is enabled for Safari
MacOS 11.0.1
Safari Version 14.0.1 (16610.2.11.51.8)

have you tried adding a pause between actions?

Also, I don't see a Translate option in my Safari (Catalina)

Edit: Ah you have Big Sur.

Sometimes it works to have TWO Select actions:
1st action: Select View
2nd action: Full menu selection

Thanks for your quick reply. The two-step approach doesn't work either, regardless of how I configure it, but I will remember that in future.

  • do you have the Develop menu enabled? (Preferences > Advanced)
    and,
  • do you have "Allow JavaScript" enabled?
    Screen Shot 2020-12-14 at 2.16 PM

Yes on both counts, thanks. I will try recording mouse events tonight. Driving me nuts trying to tea h myself Spanish.

I was able to make the Translate button in Safari work via automation using pixel coordinates, but that is very much a kludge. I would still like to learn why selection of the menu item described originally gets flagged as "disabled". I feel like I either 1) have something to learn or 2) that such disabling is an intrinsic feature of Safari.

tried adding pauses?
btw, there are some posts about menus not being able to be selected, sometimes because they are dynamic

Helpful, thanks! I had indeed put in 10 sec pauses for proof of concept only. I was unaware of dynamic menus. I’m sure they have advantages, but automation is not one of them!