Hi,
I'm trying to read a folder on a mapped network drive, but is doesn’t work.
The strange things is that the script work when i test it with a fixture pane in SwitchScripter, and give me the results.
When i run the script whitin a flow i got an error. (Error in line 56 of script : Error. Trying to access undefined member '3')
Any suggestion?
Here my code
function GetMyFolderList(mydir){
var MyDir = new Dir(mydir);
var FolderList = MyDir.entryList("*");
return FolderList;
}
function jobArrived( s : Switch, job : Job )
{
// work on test, not work in a flow
var lista = GetMyFolderList("X:\\");
s.log(1,lista[3]); // Error in line 56 of script : Error. Trying to access undefined member '3'
// work on test, work in a flow
var lista = GetMyFolderList("C:\\");
s.log(1,lista[3]);
}
reading folder on a mapped network drive - not work
Re: reading folder on a mapped network drive - not work
Have you tried with another item from the list, like the first one [0]
Re: reading folder on a mapped network drive - not work
Yes, I've tried now, but nothing to do. Same error.
Error in line 54 of script : Error. Trying to access undefined member '0'
Its probally Javascript that doesn't read a network drive?
Error in line 54 of script : Error. Trying to access undefined member '0'
Its probally Javascript that doesn't read a network drive?
Re: reading folder on a mapped network drive - not work
Have you tried with the server name instead of X, like //SERVER_NAME/
Re: reading folder on a mapped network drive - not work
I'm not sure that's a valid call for an entry list. It should have 3 arguments like this:
entryList( filter : String, filterSpec : Number, sortSpec : Number )
or in your code
var FolderList = MyDir.entryList( "*.*", Dir.Files, Dir.Time);
That would return all files sorted by modified date.
If that doesn't work try outputing the results in a log message:
s.log(1, lista.toString());
to see if you're returning anything valid from your function call.
entryList( filter : String, filterSpec : Number, sortSpec : Number )
or in your code
var FolderList = MyDir.entryList( "*.*", Dir.Files, Dir.Time);
That would return all files sorted by modified date.
If that doesn't work try outputing the results in a log message:
s.log(1, lista.toString());
to see if you're returning anything valid from your function call.
Re: reading folder on a mapped network drive - not work
I try with //SERVER NAME/ and it work fine!!!
Thanks!!
Thanks!!