Select Menu Items Actions Not Working in Vivaldi

Playing around with the Vivaldi browser, I can't get any Select Menu Items actions to work. Any idea what's going on?

Please post the actual Macro you are using.
See How to upload your macro .

I tried it with several different menu items; here's a basic example:

Select or Show a Menu Item Macro (v9.0.3)

Select or Show a Menu Item.kmmacros (2.0 KB)

Since Vivaldi is a Chrome-based browser, you must enable all of the same stuff for it that you do for Google Chrome:

  • enable JavaScript
  • Enable "Allow JavaScript from Apple Events"

See:

It it a cross platform application perhaps?

Cross platform applications, including many Adobe applications, do not necessarily update or even build their menu bar until the menu is selected with the mouse. When asked for the menus via the accessibility subsystem, the menus are either not there, or not currently correctly built for the context (eg, menus may be disabled or invisible when they should not be).

Options to force the application into updating its menus include:

  • Switch out and back to the application, and then use the Select Menu Item action.
  • Use the Show Menu variant (leave the item field blank) of the Select Menu Item action to show the menu item first, and then the Select Menu Item.
  • Simulate a click in the menu bar, and then use the Select Menu Item action.
  • Desperate measures, simulate a click in the menu bar, and then use arrows and typeahead (Insert Text by Typing) to select the menu item.

I'm still having the same issue.
BetterTouchTool cannot trigger the menu click either. So the problem is probably with Vivaldi and not with KM or BTT.
If the menu item has keyboard shortcut, send keystroke to front app will work:
image

Sometimes app menus are dynamic, so try selecting the top level menu first, once,
then (again) do a menu selection, but this time selecting the whole menu path again.

Also, I've seen BTT sometimes needs an additional "Activate App" action in KM for BTT to work.
I mean, sometimes BTT needs to activate an app so it is sent to the front. Only have seen this odd behavior with BTT, but it works.

In my tests this method fails in Vivaldi. They seem to be doing something quite unorthodox...

-Chris

Hi There,

Is there a solution to this problem in the meantime?

Best, Matze

Hey Christian,

That's pretty easy to just test and see...

This works for me in Vivaldi 5.6.2867.40 on macOS 10.14.6 Mojave.

-Chris


Menu ⇢ Bookmarks.kmmacros (2.3 KB)
Keyboard Maestro Export

Hey Chris,

Of course I did test it with macros I've created. Because they did not work, I asked.

Best Matze

Mac OS 13.0.1
Bookmarks.kmmacros (2.1 KB)
Bildschirm­foto 2022-12-14 um 13.26.24

Hey Matze,

You'd be surprised at often people don't test or research at all before asking questions on the forum, so "of course" is never to be assumed...

It's also a good idea to mention what versions of macOS and Keyboard Maestro you're using. (For convenience I have a macro that inserts this text for me.)

Apple has been playing games with menus in that last couple of versions of macOS and that has broken various utilities and workflows. I thought this might be at issue here, but now you’ve defined your problem I can replicate it – and I don't think this is Apple's problem – I think it's Vivaldi's.

Remove “Show Bookmarks Panel” from the action and leave “View” – this will open the view menu.

Using a second select-menu action usually works in these cases, but it does not work with my version of Vivaldi on Mojave.

I can get AppleScript UI-Scripting to select “Show Bookmarks Panel” in the menu, but it does not activate. (I had to wrestle with Vivaldi to get that done reliably.)

tell application "System Events"
   tell application process "Vivaldi"
      tell menu bar 1
         tell menu bar item "View"
            tell menu 1
               perform action "AXPress"
               
               set showBookmarksPanelMenuRef to menu items whose title contains "Show Bookmarks Panel"
               
               if length of showBookmarksPanelMenuRef > 0 then
                  set showBookmarksPanelMenuRef to item 1 of showBookmarksPanelMenuRef
               else
                  error "Get “Show Bookmarks Panel” Reference Failed!"
               end if
               
               set selected of showBookmarksPanelMenuRef to true
               
               keystroke return
               
            end tell
         end tell
      end tell
   end tell
end tell

I had to resort to selecting it and pressing Return to get it working.

Even changing the “Show Bookmarks Panel” keyboard shortcut using the system keyboard preferences fails to work. The keyboard shortcut shows it has been changed, but it does not actually perform its function.

image

I suggest you report this bug to Vivaldi.

-Chris

1 Like

Hello Chris, please excuse my "of course". I did not mean to be unkind. Thank you very much for your efforts. I have already posted the problem in the Vivaldi forum. And will now also report it as a bug. If I get an answer, I will report it here.
Best regards Matze

2 Likes

Sorry, it's probably my fault not to understand, but if you can set up the shortcut directly in Vivaldi, why do you want to set it up in KM?

Hi Frank,

Yes, the very standard shortcuts like CMD W, S, T, F and so on I do trigger via the app shortcuts, but in every app there are some commands which have weirder or no shortcuts like in Vivaldi Share ... or Capture ...

For those I want to build a conflict palette, as I am doing in all my apps, that shows these commands plus all the macros I've made for Vivaldi, so that I can choose them via first letters.

This way I don't have to remember all the shortcuts.

Best Matze

Hi Matze,

Then "Show Bookmarks Panel" (Leselisten-Panel einblenden) was just an example for something else? Because for that you can define a shortcut of your choice directly in Vivaldi.

And if a Vivaldi shortcut is just "weird", you can change it as you like.

By "capture" do you mean the Vivaldi's screenshots? So that

You can still define your palette by triggering the Vivaldi shortcuts with KM.

Sorry, I don't want to bore you with things you already know. I probably still misunderstand you :slightly_smiling_face:

I have macros for each app that I call from a conflict palette, that only opens when the app is frontmost. I find the idea of adding normal commands to this palette useful. That way everything is in one place. Which doesn't preclude me from continuing to use shortcuts. And yes, I know the Vivaldi Shortcuts pref and I am using it to assign shortcut to some commands like next tab, go back in history etc.

Ok, just one more thing, to stay with your example,

The way I see it: If F1 (or whatever) triggers a conflict palette, then you can also trigger the shortcut you assigned to "Show Bookmarks Panel" in Vivaldi with this palette. You don't need "Select or Show a Menu Item" but "Type a Keystroke".

2 Likes

Pfiffig. This is a neat workaround! :smiley:

Yes, that's what I've been trying to say all along. My English is bad.... :slightly_frowning_face: