Getting layer reference by ID
Seems like a really fundamental/basic question that I can't answer, but is there a way (in ESTK) to get a layer reference by (doc and) layer Id? This is mainly a problem if you are sending a script to be evaluated from outside like Generator plugin, i.e. you know the Id of the layer you want to do something and are giving it as a parameter to JSX scripts. First trivial option is to traverse the DOM and search for your layer but in the worst case this will take minutes. Second option would be to use AM-code as everything works with layer Ids, but then you can't use the Javascript DOM API and you are really hampering your options. Third option that is closest viable would be to set the layer as active using AM-code (which might be needed in many cases anyhow) and use the Document.activeLayer. But can you use AM-code to get a DOM layer reference? Essentially I'm looking for a Document.getLayerById().
