Original question - solution below
_Hey there, _ _as you can see, I'm new. :) I love KM already, but I've run into something where I am kinda stuck, so I thought I'd ask. My workflows are attached._
Use case: I’m drawing in photoshop with a Wacom Bamboo with four hotkeys and a pen. I have the option modifier bound on the pen. However, four buttons aren’t enough, so I’ve double-bound them - they do something whether I use opt, and they also use a switch (for example, switch between brush and eraser on keypress).
However, I find myself in need of yet another distinction Basically, I want to switch between brush and eraser, however, if I am on a layer mask, I would like the same button to swap foreground- and background-colour.
Can I somehow find out whether Photoshop is on a layer mask?
Thanks for your help already!
The key are application groups! I’ve simply duplicated my macros:
Here is the final collection of macros: (dropbox)
What it now does:
All buttons are mapped double, once with and once without OPTION.
Button 1 toggles between brush and lasso.
Button 2 sends > (my shortcut for “increase brush size”.
Button 3 sends < (my shortcut for “decrease brush size”.
Button 4 toggles between brush and lasso.
Button 1 sends CMD+Z (undo)
Button 2 and 3 send CMD+D (deselect)
Button 4 sends CMD+F (reapply last filter)
The macros for the tools will try to open pngs in preview and move them to the lower-right corner of the screen. You find these (and the corresponding AppleScript) here:
Will look like this:
Solution 2 (outdated)
This is the script I came up with. Any less hack-ish solution didn’t work.
Button 4.kmmacros (7.8 KB)
tell application "System Events" tell process "Photoshop CC" set theWindows to windows repeat with theWindow in theWindows set r1 to properties of theWindow set window_name to title of r1 if (window_name contains "Layer Mask") then return 1 end if end repeat end tell end tell return 0