Copy link to clipboard
Copied
Hi,
I was wondering if anyone could help.
I am trying to write a code which uses selections within it the problem is with the "smooth"command. If the image for some reason has a selection that is 100% of the image then the smooth command is unavailable which causes the script to stop working.
Does anyone know of a way to skip something if it is unavailable or any kind of workaround to it?
Kai
(i am using photoshop CC incase that makes a difference)
Anyway i got it just use put the script between try and end try
Copy link to clipboard
Copied
Anyway i got it just use put the script between try and end try
Copy link to clipboard
Copied
When you know something may fail because some condition may exist. A way to handle something like that is with a try and catch errors. You can have special code to handle specific errors or ignore them and just continue processing.
Copy link to clipboard
Copied
There are several selection commands that cause errrors if the entire layer is selected. If you don't want to use a try/catch block you could compare the selection bounds to the document bounds.
Copy link to clipboard
Copied
However a selection bounds could be equal to the a document canvas bounds and not be a problem. Bounds are rectangles selection can be any shape.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now