Find/Search Image - Switch mode (dark, normal) is not automatic

Hello,

For some applications, I have some keyboard shortcuts that user the "Find/Search Image on Screen & Move Mouse", to save time.

In my Mac, I have the automatic dark mode theme activated when evening comes.

So the problem is that, when the theme changes, for example light version to dark, the shortcuts no longer work, although I have selected the option "Use Different Image If Dark Mode is Active", with the respective image uploaded.

Please see the example of my Obsidian shortcuts:

The issue is solved by opening the BTT window. It seems to me that the setting is "activated" when I open the BTT windows - when I activate the BTT window, the shortcuts start to work.


  • Type of Mac: MacBook Air M2
  • macOS version: Sequoia
  • BetterTouchTool version: 4.917 (2024120103)

Unfortunately, it is not uncommon for an action to be triggered only after the BTT window has been opened and closed. I experience this when opening websites. I have gotten used to it. :slightly_smiling_face: And of course this statement does not help in any way with troubleshooting.

I'm not sure, but in your case this workaround might help: If the “if image not found” option is enabled, BTT can continue with a named trigger, which can be the next image search. So it doesn't matter which mode is set (dark or not). If the first image is not found, the second one is searched for.

1 Like

you are right, there seems to be an issue/change with sequoia that prevents BTT's current approach from determining dark mode if BTT doesn't have any open windows. I'll fix that and upload an updated version in 20min.

1 Like

Should be resolved in v4.918

1 Like

Man, it is Sunday, I was not expecting a solution in 2h :smiley: :smiley:

Thanks!

Thanks for the suggestion! It's a smart way to solve the issue, although I would assume, not so efficient.

Anyway, Andreas already did solve it :slight_smile:

Regards

1 Like

Great! Was having the same issue. I got a related question ÂżHow to return error if image was not found? So when called from a "Try" statement in applescript it would catch the error and do something else. (I'm already using a Named Trigger after founding the image to perform an action)

Thanks!

K.

	try
			tell application "BetterTouchTool" to execute_assigned_actions_for_trigger "CC5DEA7S-BEF9-4138-7897-E55F1BCB1111" --Find and click Image
		on error
			display dialog "Move cursor over button manually"
		end try

There is currently no return value for these. However you can use the similar "If Image Is Visible On Screen" action:

I was thinking what would be the best way to "simulate" an error? (to the eyes of AS "Try" statement). Otherwise maybe creating Named Trigger to return a specific variable to applescript? What do you think? (To keep the workflow of applescript try-error)

this is currently not possible, BTT's apple script infrastructure can not really return errors (at least none that can be caught)

Hello Andreas,

It's still not working, with Version: 4.918 (2024120104).
I can reproduce the issue by forcing the theme (Light or Dark) manually (duh.. I could test this yesterday after installing the new version)

Can I activate some debugging log to help you find the issue?

Thanks

There are no logs for this unfortunately.

Are you sure it works in general? Maybe it just doesn't find the dark mode image with high enough certainty? (I tried 4.920 on three Macs, two on macOS 15, one on macOS 14)

Ah wait, maybe there was an issue with the uploaded build and the fix didn't actually make it to the uploaded alpha. I'll upload a new build now where I make sure it's building from scratch.

It's fixed now! Thanks!