Many html editors etc. associated js with the editor, not with the Windows Scripting engine, and sometimes some users have it associated with notepad.
Here's how I get around .js files not being correctly associated in the tools menu. In the tools menu entry definition: Command: wscript.exe Arguments: //E:javascript scriptname.js Initial Directory: C:\Program Files\AmiBroker\Scripts This works every time irrespective of your .js file association. Best regards, Richard Dale. Norgate Investor Services - Premium quality Stock, Futures and Foreign Exchange Data for markets in Australia, Asia, Canada, Europe, UK & USA - www.premiumdata.net From: Ken Close [mailto:[EMAIL PROTECTED] Sent: Friday, 5 January 2007 10:10 AM To: [email protected] Subject: [amibroker] JS File Opens Rather than Executes Hello: I am trying to help a friend run a simple JS script file in order to export some images of charts. I used a js example (from Help) file as follows: AB = new ActiveXObject("Broker.Application"); Win = AB.ActiveWindow; Win.ExportImage( "DC_Test.bmp", 640, 480 ); I instructed him to install the file in the Plugin folder, then use the Tools>Customize box to add the file name to the drop down list in the Tools menu. Opening a chart, then clicking on Tools>name of js file will execute the file and export the active windows image. I know because this works fine on my computer. He reports that after following all of the steps I sent him, he clicks on the js filename in the Tools drop down, and the file pops open in Notepad rather than executing. Is this possible (it must be as he reports it is happening). What would cause this and what step(s) can I suggest he do so the process operates like it is supposed to (and like it does correctly on my machine). My friend is not a member of this conference so I will direct any suggestions to him. Thanks for any help. Ken
