Guest Posted February 20, 2018 Share Posted February 20, 2018 I would like to have a shortcut to select the layer below or above the currently selected layer. In Affinity Photo I was able to create a macro which does exactly that. However, I couldn't find a way to assign a shortcut to this macro. So my wish is to either have: 1) a separate menu item to select a layer below or above the currently selected layer 2) a method to assign shortcuts to individual macros Quote Link to comment Share on other sites More sharing options...
Guest Posted February 21, 2018 Share Posted February 21, 2018 I managed to solve the problem by using the following AppleScript as a workaround: tell application "System Events" tell process "Affinity Photo" local selectedIndex tell (first window whose value of static text 1 is "Opacity:") tell table 1 of scroll area 1 tell (first row whose value of attribute "AXSelected" is true) set selectedIndex to value of attribute "AXIndex" end tell select row (selectedIndex + 2) end tell end tell end tell end tell Of course this would need a lot more error checking (bounds check of index, visibility of layers panel), but it works for now. And here is an AppleScript that lets you rename the currently selected layer. For me this works in separated window mode, so you probably need to tweak it for your layout. tell application "System Events" tell process "Affinity Photo" tell (first window whose value of static text 1 is "Opacity:") perform action "AXRaise" tell table 1 of scroll area 1 tell (first row whose value of attribute "AXSelected" is true) tell text field 1 of UI element 1 set value of attribute "AXFocused" to true end tell end tell end tell end tell end tell end tell Quote Link to comment Share on other sites More sharing options...
thomaso Posted May 26, 2022 Share Posted May 26, 2022 On 2/21/2018 at 12:35 PM, catcat said: Of course this would need a lot more error checking (bounds check of index, visibility of layers panel), but it works for now. Any idea how I can fix it here? It seems to be stuck at "value". error "„System Events“ received an error: „window 1 of process \"Affinity Publisher\" whose value of static text 1 = \"Opacity:\"“ can not get read. Invalid Index." number -1719 Quote macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1 only Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.