AppleScript command to reveal the Settings window?

Got a problem with Viscosity or need help? Ask here!

luckman212

Posts: 17
Joined: Mon Sep 08, 2014 10:07 am

Post by luckman212 » Sun Aug 25, 2024 11:44 am
I would like to be able to open Viscosity's Settings window (with the list of connections) via script, Terminal command, etc.

Is there any way to do this?

luckman212

Posts: 17
Joined: Mon Sep 08, 2014 10:07 am

Post by luckman212 » Sun Aug 25, 2024 10:02 pm
Looking at the app's Info.plist I see it also supports 2 URI schemes:
Code: Select all
open://viscosity:_______
open://viscosityserial:_______
Are there parameters available to this URI scheme? I prefer this to having to use osascript for sure.

James

User avatar
Posts: 2360
Joined: Thu Sep 04, 2008 9:27 pm

Post by James » Mon Aug 26, 2024 11:46 am
Hi luckman212,

It's possible to do this using AppleScript, however I'm afraid we don't have a ready-made script we can provide. You can look up documentation for controlling UI elements with AppleScript to simulate opening Viscosity's menu and clicking on the Settings menu item. You could also try using a tool like Automator to record actions for you.

Cheers,
James
Web: https://www.sparklabs.com
Support: https://www.sparklabs.com/support
Twitter: https://twitter.com/sparklabs

luckman212

Posts: 17
Joined: Mon Sep 08, 2014 10:07 am

Post by luckman212 » Mon Aug 26, 2024 11:50 am
Ok I'll try that but... scripting with simulated mouse clicks is very 90s style automation. I would hope there would be a little bit better way to interface with the UI.

luckman212

Posts: 17
Joined: Mon Sep 08, 2014 10:07 am

Post by luckman212 » Mon Aug 26, 2024 10:45 pm
I spent over 2 hours messing about with Script Editor and Accessibility Inspector trying to figure out how to interact with the unnamed NSStatusItem UI elements, but after reading a dozen Stack Overflow threads and talking to ChatGPT for a bit I have given up. Example:

Image

So, back to the original question:
"Is there any way to automate the opening of Viscosity's Settings dialog via commandline?"

luckman212

Posts: 17
Joined: Mon Sep 08, 2014 10:07 am

Post by luckman212 » Wed Sep 18, 2024 2:54 am
Following up on this. Hoping there is a way (or will be one day)

James

User avatar
Posts: 2360
Joined: Thu Sep 04, 2008 9:27 pm

Post by James » Thu Sep 19, 2024 2:29 am
I'm afraid I have no further suggestions that could help control Viscosity in such a manner.

If you're trying to control Viscosity to configure it, you can instead make use of Viscosity's bundling features:
https://www.sparklabs.com/support/kb/ar ... ences-mac/

If you're trying to control VPN connections, you can instead make use of Viscosity's connect/disconnect commands:
https://www.sparklabs.com/support/kb/ar ... cript-mac/

Cheers,
James
Web: https://www.sparklabs.com
Support: https://www.sparklabs.com/support
Twitter: https://twitter.com/sparklabs

luckman212

Posts: 17
Joined: Mon Sep 08, 2014 10:07 am

Post by luckman212 » Thu Sep 19, 2024 2:52 am
Thanks. I'm specifically wanting to be able to programmatically open the "Settings" panel. I don't think this is possible to do currently? Please consider this a feature request.

Image
8 posts Page 1 of 1