Automators 36: Sal Soghoian's Control Panel

I know @dfay mentioned this, but I want to re-emphasize that Duet Display works quite well for this setup. It sounds like the Luna Display is a good option, but folks should realize there is a workable option that is markedly less expensive through use of the Duet app. — jay

3 Likes

I have the two scripts in the same folder. I put them here - Home > Library > Scripts

To be activated, Script Libraries are placed in Home > Library > Script Libraries

Cheerts

1 Like

Given I already have Duet - but hardly use it :see_no_evil: :joy: - this would be a VERY cheap option for me.

Meanwhile I have StreamDecks…

Followed all the steps in the videos, double-checked file locations and privacy settings, but still the keynote panel will not show up.

When I get into keynote and press the keyboard viewer I get the standard acc keyboard with an empty custom keyboard/panel (“none”)

The list of “special panels” when I click the gear icon is also empty even though the file is in the AssistivveControl directory.

Any ideas?

I have this same/similar problem. Using Mohave. I always get the standard accessibility keyboard when I use the menu bar item to Show Keyboard Viewer This standard Accessibility keyboard has grayish keys and does not have a button for Panels.
I have not found the trick to make the menu bar item show the keyboard that shows up when I check off Enable Accessibility Keyboard. Whenever I dismiss this Accessibility keyboard (hitting the X) I have to navigate back to the Accessibility Keyboard area and recheck the check box for Enable Accessibility Keyboard which will have become unchecked.
I am experimenting with just displaying the keyboard on the Mac itself, My thought is that if I can get it to work on the Mac display that I can make the step to buy the Luna display, but I cannot get past this hurdle.

A possible workaround is never to use the X in the upper left corner of the Panel Keyboard when you want to dismiss it. Rather in the Options… select a Hot Corner to Hide / Show Home Panel. Uncheck Panel Follows Hide/Show Home Panel (otherwise the Panel Keyboard will reappear near the corner that you are using as your Hot Corner rather than the location that it formerly occupied. Then whenever you want the Panel Keyboard to disappear, make sure to use the Hot Corner. Never use the X. The Hot Corner is now responsible for making it appear and disappear.
In this scenario, the menu bar item with its Show Keyboard Viewer, has no usefulness that I can understand. It merely brings up the Standard Accessibility Keyboard which does not seem useful in this context.
When you have your Custom Panel on the screen (or I assume iPad), do not use the X there either to dismiss it. Use the Hot Corner.
If there are others who understand this issue better than I, I would like to know why the video encourages you to place the menu in the mini-menu bar that is supposed to Show Keyboard Viewer. I do not understand why this is useful.

It is my understanding that the menu bar item to “Show Keyboard Viewer” in Mojave always shows a standard keyboard, which is actually (at least on my system) different from the standard accessibility keyboard panel as well. To have this work as you are looking to do, you need to be on Catalina.

My approach has been to create an AppleScript that shows and hides the accessibility keyboard/panels, which I execute from Alfred with either a keyboard trigger (I used control-shift-option-command-P using the meta key reprogramming of caps lock via Karabiner) or with a keyword.

My current script (will provide code if anyone would find it useful) now launches System Preferences if necessary, switches to the accessibility panel, toggles the accessibility keyboard status, responses to the dialog if needed that comes up when you disable the keyboard, and goes back to the previously visible System Preferences panel (or main display) or quits System Preferences depending on its status prior to execution.

For me, I am going to stick with this approach even when I eventually upgrade to Catalina since it’s actually way faster than a menu bar selection anyway.

2 Likes

I would find the Apple script code valuable.

Here is the script I use inside Alfred:

on run argv
	--set theQuery to item 1 of argv

	set isRunning to application "System Preferences" is running
	
	tell application "System Preferences"
		if not isRunning then
			launch
		else
			set currentPane to the current pane
		end if
		reveal anchor "Keyboard" of pane id "com.apple.preference.universalaccess"
	end tell
	
	delay 0.5
	
	tell application "System Events"
		tell application process "System Preferences"
			tell window "Accessibility"
				tell group 1
					tell tab group 1
						click radio button "Accessibility Keyboard"
						set theCheckbox to checkbox "Enable Accessibility Keyboard"
						set isChecked to value of theCheckbox
						click theCheckbox
					end tell
				end tell
				if isChecked is 1 then
					delay 0.5
					click button 1 of sheet 1
				end if
			end tell
		end tell
	end tell
	
	tell application "System Preferences"
		if not isRunning then
			quit
		else
			if currentPane is (missing value) then
				set show all to true
			else
				set current pane to currentPane
			end if
		end if
	end tell

	--return theQuery
end run

Note that the on run argv and end run parts and the references to theQuery are Alfred specific as Alfred calls a run handler and can supply its “{query}” to the script in the form of an argument called “argv”; if you are going to run this for example inside Keyboard Maestro you won’t need those.

I’m on Catalina and have the same issue. I cannot get this to work.

I’ve been able to get this working (somewhat): I imported the panel Sal made into the panel opened in the panel editor when you start that up. I now have access to all panels in the apps they are related to. A bit of a cumbersome (and not very intuitive) way to do it, but it kinda works for now…

This reminds me of a more customizable “Actions” for iPad. This was my jam back in the day. https://www.engadget.com/2013/04/09/actions-for-ipad-automating-your-computer-from-the-ipad/

Been waiting for the possibility of a Black Friday sale on a Stream Deck XL but now thinking this is a nicer option and certainly a whole lot of fun designing the buttons and panels. Although with the Stream Deck I do love the idea of having physical buttons always ready to go. I also don’t have a spare iPad handy so I’d have to remember to hook this up to sidecar when I get to my desk, but wow this is amazing!

1 Like

This is nice and definitely an option to the Stream Deck. However, I don’t believe there is a way to keep the iPad from hijacking the cursor. I know this is how it’s designed to work, but I still need to return my cursor to the main display once I select an option within the panel placed on the iPad.

I think this reason alone makes the Stream Deck a better option? Unless I am missing an option to keep touch on iPad from taking the cursor from the main display?

I really enjoyed this podcast! I could swear that this podcast was the one where @Sal gave some sage advice for storing AppleScript subroutines in a specific place that could be accessed from other scripts. I have re-listened to the podcast about 3 times, but can’t seem to locate the reference. Am I going crazy or just mixing up my Soghoian lore?

You might be thinking of the first episode we interviewed Sal in:

Here is the Apple reference

https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/UseScriptLibraries.html

1 Like

Bingo @RosemaryOrchard and @jayelevy! That is exactly what I was looking for. I love the Automators podcast but listening to the podcast again was going to kill me :grinning:

2 Likes

I just got to listen to this podcast, and I love this. I have an old iPad that isn’t being used, and a copy of Duet, and got going pretty easily.

I’d like to get multiple panels and have the appropriate one be displayed depending on the app that is foreground. I understand how that works and it is pretty easy.

What I’m hoping to find out, is if there is a way to ‘embed’ one panel in another. What I would like is to define a set of app related buttons that live in one panel, and I can embed that in other panels so that for any app I am in, I have my common apps at the top, then the custom buttons for the foreground app below that.

Any guidance is much appreciated. I suspect I will have to create a base panel, setup my app switcher buttons and group them, then copy that group to every other app specific panel. This is doable, but not very automated :slight_smile: