How do you assign a keyboard shortcut or hotkey in sketchbook pro? - applescript

I'm using Sketchbook pro for mac, the documentation that states: "Many of the tools found in the lagoon and menus have assigned hotkeys. You can also check out the Preferences window for a list of them or to remap a tool." However, the link they provide does not give information about how to remap commands.
So trying to switch gears and use hotkeys instead, now the documentation describes a method of assigned hotkeys; however, this doesn't work and nothing happens. Also mysteriously the documentation shows the lagoon with the ability for hotkeys however on my desktop this isn't what I see (see figure below)
Ultimately my goal is to assign commands to my tablet, literally I just want to assign the r key to the rectangle tool instead of the ruler as shown. The problem is that on my Wacom I can only use keystrokes and as it is there is no keystroke for the rectangle command, so frustrating.
It seems like it would be so simple to just "assign keyboard shortcuts in sketchbook pro" but I can't find a single example of it actually happening, I only find references to it being possible, like for example the end of this video see image below:
I don't mind trying to figure out how to use Applescript but I can't find any information on how to talk to sketchbook with applescript. Frustratingly there is an interface to run Applescripts...but no information about how to write applescript to interact with sketchbook commands, see figure:

I'm not sure about applescript, so I hope someone else can help.
You cannot set your own shortcuts inside of SketchBook.
You can only select from the list provided.
In your screen-cap the context of that video is setting your Wacom tablet buttons to Sketchbook hotkeys. That end slide is attempting to communicate that you can use our suggestions (which are listed in the video) or make your own configuration from the available hotkey list. It's not meant to say that you can create your own custom hotkeys.
What are you using the rectangle so much for? 🤔

Regarding AppleScript, I've checked via Autodesk Support and they replied they currently do not support it.
The fact that you see your script appearing in "Sketchbook Pro > Services" is a MacOS feature, it doesn't necessary mean Sketchbook knows about it.

Related

Mac OS X 10.10 Find window by title, find button by label and press it

I use Mac OS X 10.10 and I would like to write a program that looks continuously for a window analyzing all the names of the opened windows. When the windows appear, I would like that the program will look for a button with a specific label and once found it, the app should send it a "pressed message".
I would be able to do it under windows, but I am not so familiar with Mac.
I have found a question related to mine (How do I get a list of the window titles on the Mac OSX?), but I think the most difficult part is finding the button and sending it a "pressed message".
Thank you in advance!
What you are looking for is the Accessibilty APIs. These are mostly Core Foundation style C APIs and typically prefixed with AX.
You might also want to consider additional identifiers beyond window title as window titles are not necessarily unique.
Using the AX APIs is not easy and is extremely verbose. You can use them to explore the UI and find things and interact with them but you might have more limited success observing user interaction. That might require a more fragile combination with event monitoring using NSEvent globalMonitor or CGEventTap depending on the UI widgets involved.
Also note that using the AX APIs to control anything outside your app is not sandbox capable.

Toggle between "Extend these displays" and "Show desktop only on 1"

I'm looking for a way to programmatically alter the video properties in Windows 7. I'd like to toggle the Multiple display state (as seen in Control Panel > Appearances and Personalization > Display > Screen Resolution) between "Extend these displays" and "Show desktop only on 1".
This is the sort of thing that I think is probably doable just by knowing the right Windows executable/dll to invoke with the right parameters and bundling that into a script or shortcut, but if so that information eludes me.
Actual code solutions are fine, of course, but I'd like the change to be permanent and not just disable the other monitor(s) for the duration of the application.
If you are still interested in the answer, the shortcut is win+p. You can use Autohotkey for scripting and call autohotkey script from your program. It is a workaround but better than nothing.

Get title of front window in carbon

I am writing a program to sit in the background on osx 10.6, listen to keystrokes and record them, grouping them by window title. (No, I am not writing malicious software. I do not need this program to be sneaky in any way, I just want to have a safety net for when I have typed a huge email and then accidentally refresh the page (APPLE-R) instead of opening a new tab (APPLE-T)) I have already found apple's EventMonitorTest example for the keystroke capturing code, now I just need to find the "key window" title.
Does anyone know where I can find examples for this kind of functionality? Thank you!
A couple of possibilities:
You could use the Accessibility API (though of course keep in mind that 64-bit Carbon does not support this)
You could use the CGWindow functions introduced in Leopard
I suspect the first option will be easier to do this with, since the CGWindow API is somewhat low-level and treats all windows (application windows, menu bars, dock icons, etc.) more or less equally.

intercepting keystrokes in OSX

I'd like to be able to listen to keystrokes systemwide in OSX to implement an utility like AHK on windows (the shortcuts part of AHK anyway), recognizing not only simply combinations of keys, but even more complex things like sequences etc..
I need someone to point me... where to start? How to listen to keybard events system wide? Maybe there's something in the cocoa framework or that's not where to look for?
Quartz event taps. Look up CGEventTapCreate in the Xcode doc viewer to get started. Note that the user must check "Enable access for assistive devices" in the Universal Access preference panel before you'll be able to monitor keyboard events. (And even then you won't see keystrokes within password fields.)

Cocoa NSStatusBar Global HotKey

I have created an NSStatusBar cocoa application which sits in the system status bar.
I want to assign a hotkey so that when pressed it toggles my applications and show the menu.
Is this possible?, In my searching and experimenting I have found a few different ways of assigning global hot keys that can be pressed when your application is in the background but I can't find any way to problematically make the menu show.
Is this possible?, If anyone thinks a way of assigning a global hotkey is best please post it.
Thanks.
One of the hotkey tutorials I found was on http://dbachrach.com/blog/2005/11/program-global-hotkeys-in-cocoa-easily/ for anyone interested.
If you're targeting 10.6+, there's some new API for NSEvent that can do global hotkeys. For more information, check out this awesome blog post: http://cocoakids.net/global-hotkeys-in-cocoa-on-snow-leopard
EDIT (a long time later)
Tooting my own horn a bit: I could never get things like PTHotKey and other libraries to work the way I was expecting, so I eventually gave up and wrote my own HotKey wrapper. It has a very simple API (you give it a key code, modifiers, a target, and an action), that even supports fun things like 10.6's blocks. You can download the source here: http://github.com/davedelong/DDHotKey
There is an actual hotkey API, which still exists in Snow Leopard and is available in 64-bit. It's designed specifically for this purpose, unlike the NSEvent methods, which are essentially just a block-based wrapper around CGEventTaps.
The difference is that the NSEvent methods (or CGEventTaps directly) make you look at every event that comes in, whereas the hotkey API only calls your function when the user presses your hotkey.

Resources