select ant visible layer to avoid General Photoshop error
I create a script which cycles through all my layer comps, resize them and save to various folders.
one of the command i use is:
activeDocument.mergeVisibleLayers();
I finally figured out that i would get this error message:
Error: General Photoshop error occurred. This functionality may not be available in this version of Photoshop.
- The command "Merge Visible" is not currently available
when i am running the script when a non visible layer is currently selected.
This can happen when a new layer comp is selected where the active layer should be turned off.
Is there an elegant way to force a selection of a visible layer when the script runs to avoid such errors?
Thanks
