Skip to main content
Inspiring
May 10, 2013
Answered

Script not worked in Photoshop

  • May 10, 2013
  • 1 reply
  • 604 views

Hi !

My script is worked in  ExtendScript Toolkit, but doesn't worked in PS SC6 via export from Configurator 3. What is problem ?

#target photoshop;

var mainFolder = "~/testFolder";

var PrinterFolder = mainFolder  + '/printer';

var myFoldersArray  =[];

var content = [];

myFoldersArray = readFolder(this.PrinterFolder);

alert(myFoldersArray );

function readFolder(folderName){//----------------------------------------------------------------------------------------------------

myFolder = new Folder(folderName);

myFoldersArray  =[];

myFoldersArray = myFolder.getFiles( function( file ) { return file instanceof  Folder} );

return myFoldersArray  ;

}

This topic has been closed for replies.
Correct answer Andy_Bat1

Not right, I'm used this markers in other parts of scripts- all worked. I'm thing what mistake (are marked):

var myFoldersArray =[];

myFoldersArray = readFolder(this.PrinterFolder);

function readFolder(folderName, newName){//----------------------------

myFoldersArray =[];

}

I'm change name of the array myFoldersArray1 in the function and delete link "this" - script are worked.

1 reply

Paul Riggott
Inspiring
May 10, 2013

There are various ways of using a script with configurator. I am guessing you have pasted in the code, if so the problem could be the comment //----------

Remove the comment or make sure coments are in the form of /* this is a comment */

Andy_Bat1AuthorCorrect answer
Inspiring
May 10, 2013

Not right, I'm used this markers in other parts of scripts- all worked. I'm thing what mistake (are marked):

var myFoldersArray =[];

myFoldersArray = readFolder(this.PrinterFolder);

function readFolder(folderName, newName){//----------------------------

myFoldersArray =[];

}

I'm change name of the array myFoldersArray1 in the function and delete link "this" - script are worked.