action wizard filenames to array
I'm trying to store the filepath and filename of several PDFS in an array. I'm using the action wizard and executing the code below.

if ( typeof global.zArray == "undefined" ) {
global.indexCnt = 0;
global.zArray = new Array();
}
var path2file = this.path;
var re = /.*\/|\.pdf$/ig;
var filename = path2file.replace(re,"");
var filepath = path2file;
global.zArray[global.indexCnt] = [filepath,filename];
global.indexCnt++;
I tried viewing all the elements in the array after all the files processed using the code below, but it only prints the last filepath and filename in the folder.
for (i=0;i<global.zArray.length;i++)
{
console.println(global.zArray);
}
What am I doing wrong??
