To get something, you don’t need to be in modal state. Only to change something. So getByName() shouldn’t be an issue. But setting layer as selected - is a state change and needs to be executed in modal state
Hey @JasonM ,
I just tried to implement the "getByName(“Name”) and it did not work for me either.
I was executing it in a modal state.
3 years after this initial post. Do we have a solution to this question by now?
app.activeDocument.layers returns only top level layers. If you want some layer from sub-tree, you’ll have to search recursively. What console shows for app.activeDocument.layers?