BlueM / cliclick

macOS CLI tool for emulating mouse and keyboard events

Home Page:https://www.bluem.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logitech triple-click macro on macOS

mhillebrand opened this issue · comments

Greetings. I have a Logitech G703 Lightspeed mouse whose driver has a bug on macOS. That is, it's impossible to create macros such as a double-click or triple-click. I've tried everything, including complaining to Logitech support after every driver update for 16 months and counting. This bug does not exist on Windows. Argh.

Anyway, I thought I might try the Launch Application feature of Logitech's GHUB software by writing a shell script that executes a cliclick command for triple-clicking at the current mouse position:

#!/bin/zsh
cliclick tc:.

image

This shell script does indeed work, but when I tell GHUB to launch this "application," it doesn't do anything.

Have you got any ideas here? Logitech sure doesn't... Their solution is to give me a refund rather than to fix the bug in their software.

Thank you!

image

The question is if the software – which I hadn’t heard of until reading your issue – is really able to launch an application, i.e. if it works with a “regular” application and only fails with a shell script. If that’s the case, I’d suggest packaging the shell script as an application bundle. You could do that by hand, but the easiest solution would be to use Platypus. (Which is also available via Homebrew, in case you got cliclick from Homebrew.)

Platypus looks like a handy tool. I tested GHUB by launching Stocks.app, and it did work, so I think your theory is correct. However, the app created by Platypus appears to switch the OS context very briefly (even when Run In Background is checked), so there's nothing to be selected (triple clicked). Perhaps I could find a macOS CLI command for switching back to the previously opened window—like Cmd-Tab does—and invoke that within my shell script just before executing cliclick?

Or maybe there's another approach to try... Hmmmm. Anyway, thank you for the advice!

I just tried the -j and -g options for the open command for launching an application as hidden and/or in the background, but none of these worked:

image

Just tried simulating Cmd-Tab on the keyboard before cliclick tc:. with AppleScript. I even used osacompile to create an .app, but it doesn't quite work—even outside of Logitech GHUB.

image