plugins.file.showFileOpenDialog

Questions and answers on developing, deploying and using plugins and JavaBeans

plugins.file.showFileOpenDialog

Postby christof.brenke » Thu Oct 15, 2015 11:11 am

Hello everybody.

I tried out the file-plugin above. I searched the forum on that topic, but I still can´t get this working.


I´m getting an error with ="TypeError: Cannot read property "length""
What am I doing wrong or is something missing?

Code: Select all
function onActionDir(event) {

/** @type {plugins.file.JSFile[]} */
datei = plugins.file.showFileOpenDialog(null,null,false,new Array("JPG", "jpg"),upload(),'Datei auswählen');

function upload(){
   for (var i = 0; i < datei.length; i++) {
   application.output('Datei: ' + datei[i].getName());



Thanks in advance for your Help.

Regards,
Christof
christof.brenke
 
Posts: 11
Joined: Wed Aug 12, 2015 3:45 pm

Re: plugins.file.showFileOpenDialog

Postby Peter de Groot » Thu Oct 15, 2015 11:51 am

Hi,

Try this,

Code: Select all
function onAction(event) {
   
   /** @type {plugins.file.JSFile[]} */
   var datei = plugins.file.showFileOpenDialog(null,null,false,new Array("JPG", "jpg"),upload,'Datei auswählen');
}


then created a separate function,

Code: Select all
function upload(datei){
      for (var i = 0; i < datei.length; i++) {
        application.output('Datei: ' + datei[i].getName());
      }
}


Regards,

Peter
User avatar
Peter de Groot
 
Posts: 215
Joined: Thu Jan 10, 2008 8:38 pm
Location: Not sure...

Re: plugins.file.showFileOpenDialog

Postby christof.brenke » Thu Oct 15, 2015 12:17 pm

Hello Peter,

that worked.

Thanks a lot.

Regards,

Christof
christof.brenke
 
Posts: 11
Joined: Wed Aug 12, 2015 3:45 pm


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 24 guests

cron