• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

problems in old scripts with PS СС2015

Explorer ,
Mar 05, 2017 Mar 05, 2017

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 ?

TOPICS
Actions and scripting

Views

547

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Contributor ,
Mar 06, 2017 Mar 06, 2017

Copy link to clipboard

Copied

Could you post the full script

so you can not do much

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 06, 2017 Mar 06, 2017

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));

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 06, 2017 Mar 06, 2017

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));

}

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 06, 2017 Mar 06, 2017

Copy link to clipboard

Copied

Not worked, Alert is showing and next step gives Error

PrtScr capture.jpg

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 06, 2017 Mar 06, 2017

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.

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 07, 2017 Mar 07, 2017

Copy link to clipboard

Copied

Bonjour

By changing var sui_imgs = new Array ();

By var sui_imgs = new Array ("");

It seems to work ...........

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 07, 2017 Mar 07, 2017

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...

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 09, 2017 Mar 09, 2017

Copy link to clipboard

Copied

LATEST

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 !

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines