Jump to content
You must now use your email address to sign in [click for more info] ×

Select Layer Below/Above Current Layer (Shortcut)


Guest

Recommended Posts

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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

  • 4 years later...
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

1513302867_scriptlayerselectionnextlayer.thumb.jpg.6e4ed791ff28b0c3e27bf438059a24a0.jpg

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.