hello
I can now finally save charts as a image thro afl. here is the code. 
However there is one glitch that i cannot figure out. if the path ic 
c:\program files XXXXX it does not work. however if i put the js file 
in my c:\temp it works. i cannot understand why there should be this 
difference.

                                //AlertIf(True,"Exec  
C:\\temp\\exportImage.js" ,"Launching ext app for picture",3,2);
AlertIf(True,"Exec  C:\\Program 
Files\\AmiBroker\\Formulas\Custom\\exportImage.js" ,"Launching ext 
app for picture",3,2);



The js file is 
function DateDemo(){

   var d, s = "";

   d = new Date();
  s += d.getFullYear();
   s += d.getDate() ;

   s += (d.getMonth() + 1) + "_" ;
  s += d.getHours() ;

   s += d.getMinutes() ;
   s += d.getSeconds() ;




 

   return(s);

}


AB = new ActiveXObject("Broker.Application");
Win = AB.ActiveWindow;
Win.ExportImage( "c:\\temp\\" + Win.document.name+ "_" + DateDemo() 
+".bmp", 800, 600 );





Reply via email to