Picture judgment

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

meiyunyou
Posts: 20
Joined: Tue May 26, 2020 9:11 am

Picture judgment

Post by meiyunyou »

My English is not good, I am a Chinese
Thank you for your help
How to judge the PS didn't open the picture

PS didn't open the picture suggests that I did not open the picture
User avatar
Kukurykus
Posts: 528
Joined: Mon Jul 25, 2016 12:36 pm

Re: Picture judgment

Post by Kukurykus »

Post your code.
meiyunyou
Posts: 20
Joined: Tue May 26, 2020 9:11 am

Re: Picture judgment

Post by meiyunyou »

Code: Select all

var layer = app.activeDocument.activeLayer;
layer.applyClouds ();
If photoshop didn't open the picture, Tip did not open the picture

Just add a warning window
User avatar
Kukurykus
Posts: 528
Joined: Mon Jul 25, 2016 12:36 pm

Re: Picture judgment

Post by Kukurykus »

Code: Select all

documents.length ? activeDocument.activeLayer.applyClouds() : alert('Open an document!')
meiyunyou
Posts: 20
Joined: Tue May 26, 2020 9:11 am

Re: Picture judgment

Post by meiyunyou »

Thank you very much, sincere thank you