Based on this documentation, it seems that it is only possible to get a list of top-level layers. Is there a way to get a list of layers from inside groups? It seems there must be a way I would think.
Because typescript is just a superset of javascript any javascript code is also valid typescript code. If you use Visual Studio Code and try to copy-paste this code into a .js file it will warn you with the red squiggly lines. That’s part of the code that needs to be removed
Thanks!
I use Brackets. I’m not a “real” programmer so I don’t use Visual Studio. I know just enough to hack together some javascript to make my Photoshop ideas work
You’re welcome I also used Brackets before and I love the color theme it has so when switched to VS code I found and immediately installed that same color theme.
Brackets
I built my first enterprise CEP plugin with it because the IT department wouldn’t let me install VS Code.
I smashed out ≈10k lines of code in 3 months having never written a jot of JS in my life and tbh Brackets’ simplicity definitely helped with that - I’ll always have a soft spot for it.
That said, VS Code is flipping great and much like Photoshop it can seem really daunting at first because it is so feature rich, but when you realise that you only need about 10% of those features to actually produce working code it’s not so bad.
Definitely worth giving it a shot - it’s worth it for IntelliSense alone (the thing that reads your code as you type and autocompletes).
as mentioned in other topics, layers is a proxy not an actual array.
you can loop through it like arrays just not using for-in, you can the good old for i++ or for-of
Also, if you don’t want to show the error to the user, but still want to log it for debugging purposes you can wrap the entire logic into try...catch block. Something like this: