Copy link to clipboard
Copied
stopped working old scripts with the command
ScriptUI.newImage(imgs[0]);
Error - Invalid image data. In JS Guide write:
ScriptUI.newImage ( normal, disabled, pressed, rollover );
normal - The resource name or path to the image to use for the normal or default state.
I tried to specify the path to the file with the text to make a resource using File(). The error does not change.
Please tell me how to fix it ?
Copy link to clipboard
Copied
Could you post the full script
so you can not do much
Copy link to clipboard
Copied
var sui_imgs, imgs = new Array();
var folder = "/c/temp/test";
var files = folder.getFiles();
for (var n = 0; n < files.length; n++) {
sui_imgs.push(ScriptUI.newImage(files
}
Copy link to clipboard
Copied
I do nor know ScriptUI or javaScript onle hack at it your script code did not work at all on my machine. I made some changes it come close not but ScriptUI I know nothing about that part.
var sui_imgs = new Array();
var imgs = new Array();
var folder = new Folder("/c/temp/test");
var files = folder.getFiles();
for (var n = 0; n < files.length; n++) {
alert('File="' + files
sui_imgs.push(ScriptUI.newImage(files
}
Copy link to clipboard
Copied
Not worked, Alert is showing and next step gives Error
Copy link to clipboard
Copied
As I wrote I do not know Javascript or ScripUI. I just hack a little. The code you posted did not work at all. I fixed all but the ScriptUI part which I Know nothing about. It is documented in one of Adobe Scripting manuals it your interested you should read it.
Copy link to clipboard
Copied
Bonjour
By changing var sui_imgs = new Array ();
By var sui_imgs = new Array ("");
It seems to work ...........
Copy link to clipboard
Copied
In some old version of Photoshop Adobe changed ScriptUI. Try CC 2015, CC 2015.5 CC 2017 does not work there as the OP wrote.. I still use CC 2014...
Copy link to clipboard
Copied
I found a bug - temporarily I don't work with his computer, there was the AST CS5t, as soon as put AST CC2015 it worked 🙂 I apologize for the carelessness !