Wacom Dual Monitor Switcher with AppleScript
Update Nov 2007 Wacom has fixed this and released a driver update that allows for switching between monitors. It only works with Intuos3 or Cintiq models, so if you own one of these, download the latest drivers from Wacom.
Last week I made the switch from Windows to OSX and setup a dual display with my new MacBook and external monitor. The problem with this is how Wacom tablets behave with this amount of screen resolution.
Wacom's Intuos3 driver does support multiply monitors but is limited to:
- Span Entire Desktop: The tablet is split into two halfs making the proportions off. A circle drawn on a tablet would become an oval on screen.
- Mouse Mode: The pen acts as a mouse and turns off screen mapping and becomes a push device.
- Monitor of Your Choice: The pen will only work on one monitor and requires either a second pen or the use of a mouse to reach monitor 2.
This is fine but is missing one key option. It is not currently possible to use both monitors and switch between them. My ideal workspace would have three options at the touch of an ExpressKey.
- Full Screen: Span Monitor when needed to drag windows
- Monitor 1: Switch to MacBook Monitor
- Monitor 2: Switch to External Display
Since Wacom support forums date this request back to 2002, it's obvious that the Wacom driver may never support this needed feature. Their suggestion is to either use mouse mode, a pen for each display or to use the included mouse. Not great options.
I'm a new Apple user, I'm not a programmer and I certainly don't know AppleScript but I have managed to put something together to make this monitor switch possible.
The obvious disclaimer: I'm sure this could have been written better and it may not work for everyone but it's a start. Please feel free to comment, modify and make suggestions to what I have done.
- First thing is you need to Enable GUI Scripting. Applications > AppleScript > AppleScript Utility
- Second step is to create an applescript with the code below and save the file somewhere as an application with run only checked.
- In the Wacom Table settings, change one of the ExpressKeys to open/run and select that script from the location it was saved.
- In order for this to work, the Wacom Tablet properties needs to already be set on the pen or it will not find it.
AppleScript
tell application "System Preferences"
activate
set current pane to pane "Wacom Tablet"
end tell
tell application "System Events"
if UI elements enabled then
tell application "System Events"
tell process "System Preferences"
tell tab group 1 of window "Wacom Tablet"
click radio button "Mapping"
tell group 1
if value of pop up button 2 is "Monitor 1" or value of pop up button 2 is "Monitor 2" then
if value of pop up button 2 is "Monitor 1" then
click pop up button 2
key code 125
keystroke return
else
click pop up button 2
key code 126
keystroke return
end if
else
click pop up button 2
keystroke "M"
keystroke return
end if
tell application "System Preferences" to close the first window
end tell
end tell
end tell
end tell
end if
end tell
All this is doing is opening the Wacom preferences, changing between the monitors and closing it again. It is slow, sloppy but “Works for Me”. For whatever reason, I couldn't change the value of the pop up button by passing it a value and is why I'm using keystrokes.
This solves two of the three options. To change the tablet mapping to span both screens, I have a second ExpressKey set to this script:
tell application "System Preferences"
activate
set current pane to pane "Wacom Tablet"
end tell
tell application "System Events"
if UI elements enabled then
tell application "System Events"
tell process "System Preferences"
tell tab group 1 of window "Wacom Tablet"
click radio button "Mapping"
tell group 1
click pop up button 2
keystroke "F"
keystroke return
tell application "System Preferences" to close the first window
end tell
end tell
end tell
end tell
end if
end tell
In Summary
One key switches back and forth between the MacBook monitor and the external monitor, the other key spans both monitors for window dragging and the second click on the pen flips between modes. This is far from perfect and is a bit slow but still an alternative solution to switching between pen and mouse mode and only having one screen available to the pen.
Update Nov 2007
Wacom has fixed this and released a driver update that allows for switching between monitors. It only works with Intuos3 or Cintiq models, so if you own one of these, download the latest drivers from Wacom.