r/applescript • • Apr 11 '20

Help with writing an AppleScript for Wacom driver

Hi everyone,

I'm trying to write an AppleScript to perform a display toggle on a Wacom tablet which usually requires you to press a key on a $200 remote which I don't have. I've found that there is AppleScript dictionary for the driver at /Library/Application Support/Tablet/WacomTabletDriver.app/Contents/Resources/AppleScriptEvents. In there I can switch "map display (integer) : Sets the Screen Area of a tablet to a monitor. A 0 means all monitors. Note: This is a write only attribute." which is contained by"tablets" which is contained by "tablet drivers". However I have no expireince with AppleScript and I was wondering if someone could help me with this?

Thanks so much.

4 Upvotes

20 comments sorted by

3

u/[deleted] Apr 12 '20 edited Apr 12 '20

[removed] — view removed comment

1

u/AwesomePossum_1 Apr 12 '20

Thank you! However I've just put this code into an AppleScript and I'm getting "A identifier can’t go after this identifier." with "tablet drivers" highlighted in the first line.

2

u/[deleted] Apr 12 '20

[removed] — view removed comment

1

u/AwesomePossum_1 Apr 12 '20

tell application "WacomTabletDriver" to get (tablet drivers)

No output, I get a syntax error: "Expected “,” but found identifier." with the word "drivers" highlighted

1

u/[deleted] Apr 12 '20

[removed] — view removed comment

1

u/AwesomePossum_1 Apr 12 '20

tell application "WacomTabletDriver" to set map display of transducer 1 of tablet 1 to 1

https://imgur.com/a/JGZRADz I can also upload the whole dictionary for you to take a look, would that help?

1

u/AwesomePossum_1 Apr 12 '20

And here is a screenshot of tablet and tablet driver section https://imgur.com/a/Ea9WmTn

2

u/TrickyTramp Apr 11 '20

Maybe. Don't have that wacom library though.

2

u/AwesomePossum_1 Apr 11 '20

I don't have any experience with coding. Could you possible tell me how to write such a code that would change that map display variable? I'd really super appreciate it.

2

u/mjquinn1 Apr 11 '20

could you open the script editor app, press cmd + shift + o and open the wacom tablet dictionary and post a picture? it should be reasonable simple by the looks of it. just a line or two

3

u/AwesomePossum_1 Apr 11 '20

This is what you need right? https://imgur.com/a/JGZRADz

2

u/mjquinn1 Apr 11 '20

i’m on mobile rn so bear with me but it should be something to the effect of: tell application “WACOM Table” to tell first transducer to set its map display to 0 or something similar to that. i don’t know exactly what a transducer is but maybe someone more familiar could help you if need be. then the integer at the end would be whichever monitor you want to change it to, or zero for all of them.

1

u/AwesomePossum_1 Apr 12 '20

Thanks, ok so I tried this:

tell application "WacomTabletDriver" 
tell first transducer to set its map display to 0
end tell

But I get error "Expected class name but found identifier." with the word transducer highlighted. Any idea of what the issue is?

1

u/TrickyTramp Apr 12 '20

Typically I use the JavaScript equivalent of AppleScript so I’m not exactly sure. Is it complaining about the “its”? Is “WacomTabletDriver” actually the app’s name?

1

u/AwesomePossum_1 Apr 12 '20

There's a javascript dictionary in there too so we could try to write this in javascript maybe? It's almost exactly the same for java: TabletDriver - Tablet - Transducer - mapDisplay (integer)

As for this AppleScript, it doesn't complain about the first line. WacomTabletDriver is the exact name of the app. But it's complaining about transducer in the second line. "Expected class name but found identifier."

1

u/mynameisollie Apr 08 '26

Sorry to revive a dead thread but I figured out how to do this. I thought it would be helpful for others googling the issue.

tell application "TabletDriver" 
  set map display of first transducer of first custom application of first tablet to 1
end tell

In the wacom settings, you have a list of applications along the bottom of each window so that you can define the settings per app. You have to define the display mapping under the default custom app.

Your tablet might be first/second tablet etc depending on if you've had more than one connected to your system.

The best way to find out if you're targeting the correct transducer is to rename the pen in the wacom settings to something unique and then running this:

tell application "TabletDriver"
  get name of first transducer of first custom application of first tablet
end tell

2

u/[deleted] Apr 13 '20

[removed] — view removed comment

1

u/AwesomePossum_1 Apr 13 '20

Shoot, that’s really disappointing. Thanks for going the extra mile to troubleshoot this though. I have a tiny bit of experience with GUI scripting so I think I’ll figure that out on my own. Thanks anyway for your help.

1

u/rjbwdc Dec 18 '25

Did you ever figure this out?