Safari used to have a fixed menu item "Settings for This Website…" which has changed to include the hostname of the URL, like so:
I read in the Wiki that I'm supposed to be able to use a regex to match this, but so far I haven't been able to get
Settings for *
or
Settings for .*
to work, so I'm clearly missing and/or misunderstanding something.
1 Like
I assume you mean to use regex for action "Select or Show a Menu Item "? If that so, there's no reference for regex in the wiki. The wiki you are linking to is for conditionals (I also think that it's not quite clear. The breadcrumbs in the wiki is a bit misleading).
Otherwise, I tried the 'Menu' for conditionals and it works.
Test Regex Menu Macro (v9.2)
Test Regex Menu.kmmacros (3.1 KB)
tjluoma:
I read in the Wiki that I'm supposed to be able to use a regex to match this, but so far I haven't been able to get
Settings for *
or
Settings for .*
to work, so I'm clearly missing and/or misunderstanding something.
You are close. You need to start the menu item text with a ^
to tell KM it is a RegEx match:
^Settings for .*
That actions works for me running Safari 14.1.1 (14611.2.7.1.6) on macOS 10.14.6 (Mojave).
1 Like
That's new to me, confirmed to be working too. Thanks!
It may be worth updating the related action's wiki page about this behavior.
It is already there:
Alternatively, you can start the name with an ^ and use a regular expression to match the menu.
I know there is a lot to read, but careful reading is usually required to learn advanced features.
ybbond
July 10, 2021, 5:24am
6
Whoops sorry. I must admit that I skim the wiki page and then ⌘F for "regex"
Ah… thanks for that detail. I obviously missed it. Not used to having to 'trigger' regex, but now that I know the trick, that will come in handy.