Skip to main content
Participant
May 14, 2020
Question

Photoshop JSX script open file picture issue

  • May 14, 2020
  • 3 replies
  • 2698 views

Hi,

I have created a jsx script to bulk revise pictures in a particular folder by using the openfile function I'm able to open each file from the directory. The problem is when running the script from Photoshop there is a warning message that keeps showing up on pictures that have a different color profile assigned to it which triggers the "The embedded ICC profile cannot be used because the ICC profile is invalid" message. I can manually click continue to continue but how can i have the script just ignore the messsage and continue opening the file as is by automatically ignoring the profile message.

 

// Set Adobe Photoshop CC to use pixels and display no dialogs

app.preferences.rulerUnits = Units.PIXELS

app.preferences.typeUnits = TypeUnits.PIXELS

app.displayDialogs = DialogModes.ERROR

 

// Open and Get All Files in the Folder var imageFolder = Folder ("/Users/Cricket/Desktop/Converter/Original/") var fileList = imageFolder.getFiles()

 

// Open each file for( var i = 0; i < fileList.length; i++ ) {

if( fileList[i] == imageFolder + "/.DS_Store" )

{ }

else {

// Create a document var docImage = app.documents.add ( 800, 580 )

if( fileList[i] instanceof File ) {

open( fileList[i] )

 

Any help is appreciated it.

 

 

This topic has been closed for replies.

3 replies

c.pfaffenbichler
Community Expert
Community Expert
May 14, 2020

You could change the Color Settings for Profile Mismatches to not »Ask When Opening« and at the end of the Script restore the original settinsg. 

Participant
May 14, 2020

c_pflaffenbickler,

 

Would you happen to have the line of code that I could add inside my script to not ask when opening mismatched color settings?

 

Thanks.

c.pfaffenbichler
Community Expert
Community Expert
May 15, 2020

Just record the operation/s with ScriptingListener.plugin 

Inspiring
May 14, 2020

Do you have the ICC color profiles photoshop is trying to load installed properly?

  • In Windows, right-click a profile and select Install Profile. Alternatively, copy the profiles into the WINDOWS\system32\spool\drivers\color folder.
  • In Mac OS, copy profiles into the /Library/ColorSync/Profiles folder or the /Users/[username]/Library/ColorSync/Profiles folder.


After installing color profiles, be sure to restart Adobe applications.


Perhaps not exactly what you need, but alternatively, did you try any of the following lines already?

  • app.activeDocument.changeMode(ChangeMode.RGB);
  • app.activeDocument.convertProfile('sRGB IEC61966-2.1', Intent.RELATIVECOLORIMETRIC, true, true);
Charu Rajput
Community Expert
Community Expert
May 14, 2020

Hi,

Did you try using 

 

app.displayDialogs = DialogModes.NO

 

Or you may refer below post

https://community.adobe.com/t5/photoshop/disable-alerts-in-batch-script/td-p/9807321?page=1

 

Thanks 

Best regards
Participant
May 14, 2020

Yes, I have tried that. All it does is quits the script when it detects the picture with the ICC profile issue.