Jump to content
Sign in to follow this  
catcat

Select Layer Below/Above Current Layer (Shortcut)

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

Share this post


Link to post
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

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×