Turning a topbar context menu entry "off-tick" and never "on-tick"?

Is there some way of detecting a topbar context menu state - i.e., is a specific row Ticked On or Ticked Off?

I'd like to be able to use Keyboard Maestro as a kind of "screenset" system, where a shortcut could be trusted to turn this specific tick Off (but never on).


What kinds of solutions might there be for this?

I believe Keyboard Maestro uses the word "Marked" for what you are calling "Ticked"

Is Marked = On-Tick

Is Not Marked = Off-Tick

You want to use an else action and check whether the menu item:

  • is marked
  • is not marked
  • exists but is not marked
1 Like

Thanks TJ Luoma!.. I think this is the way to go, but I'm not entirely sure how to then go "click on it". Maybe I'm thinking about it in too complex a fashion, and should just press a shortcut key instead. That might be it?
(edited)

The keyboard shortcut is a fine option, you should also be able to use "Select or Show a Menu Item" if you want.

1 Like

Thanks! That was really helpful. At first I was trying to combine them together, i.e. "if X and Y are displayed, them shortcut A and B" but then realized that if X is on and Y is off, then the A+B shortcuts are not shot. So split them into two if then elses.

This is amazing stuff. Can't wait to dig in further. I wish there were more tutorials and blog posts and just ideas around the web. :slight_smile:

I can recommend the Keyboard Maestro Field Guide by David Sparks as well-worth the money as a great way to learn how to get better at Keyboard Maestro. I've used Keyboard Maestro for years and still learned from it.

1 Like

I was actually watching the preview of it yesterday evening and was already getting some new ideas. So I might buy it. It feels a bit expensive, but that's what I thought about Keyboard Maestro for years.. I could've easily gone without eating out at a restaurant twice if I had known what KM helps me accomplish with my music apps.

Two possible ideas that may help with the price.

  1. I believe David offers a money-back guarantee, so if you find yourself disappointed, get in touch with him.

  2. if I was friends with David in real life and he came over and spent 4.5 hours showing me all of his best Keyboard Maestro tricks, would I think that sending him a $30 Amazon Gift Card was "too much"? Probably not.

At 4.5 hours, $29 is about $6.45/hour, which isn't bad considering what lawyers usually bill :wink:

Heck, I pay $25 for a haircut, and that takes a lot less time (and oh how I can't wait to do so again!)

2 Likes

Well, I did buy it about 3 hours ago. Also tweaked one macro of his (the "place windows on the left and on the right" thing, which convinced me it was worth it, even after just looking at it from the preview). I'd love to take that one further though, but not sure how to read the logic. I was hoping to come across something like this "read if window is on the right -> then this shortcut will not move it to the right but instead move it to fullscreen". but I'm not sure how to do that.
That'd make it magic.

In fact! I even mis-listened / mis-saw what he was displaying when i re-watched his preview, and decided that cmd-alt-leftclick and cmd-alt-rightclick should also place the windows on the left corner or to the right corner. And it was possible. And it was good. I wish I could mis-hear stuff more often!

You can use the WINDOW function and SCREEN functions to determine where on the screen the window is and then adjust appropriately.

It depends a bit what you mean by “if window is on the right”. If the window was full screen (by which I'm only thinking it takes up most of the monitor, not actually in Full Screen Mode, which is different), then it would also be on the right, so that is a little unclear, and for programming automation, the first rule is you have to be very clear about what you mean.

It also depends on if you have two monitors, and how you want that to behave.

But you can do things like.

if calculation WINDOW(1,Left) > SCREENVISIBVLE(Front,Left,10%)
Move window to SCREENVISIBVLE(Front,Left)
else
Move and resize window to SCREENVISIBVLE(Front,Left), SCREENVISIBLE(Front,Width)

(I am only looking at the horizontal coordinates here, you'll have to do the vertical ones too, but hopefully you get the idea).

1 Like