| 
 PureBytes Links 
Trading Reference Links 
 | 
Hello,
The following text should give you the idea. You will need to create a file with a js extension.
	var Amibroker = new ActiveXObject("Broker.Application");
	WScript.Echo( "loading database");
	try
	{ Amibroker.LoadDatabase("e:\\AmiAust"); }
	catch ( e )
	{ WScript.Echo( "error loading" + e ); }
	WScript.Echo( "importing");
	try
	{ Amibroker.Import(0,"C:\\Documents and Settings\\Smith\\My Documents\\Ticker Data\\AWA\\Bid\\AWA0811.txt", 	"c:\\Program Files\\AmiBroker\\Formats\\default.format"); }
	catch ( e )
	{ WScript.Echo( "error importing" ); }
		
	WScript.Echo( "refreshing");
	Amibroker.RefreshAll();
		
	WScript.Echo("saving");
	Amibroker.SaveDatabase();
		
	WScript.Echo( "done");
Regards,
William Peters
www.amitools.com
-----Original Message-----
From: rsmith_den [mailto:rls_jls@xxxxxxxxxxxxxxxx]
Sent: August 11, 2003 2:59 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Automating Amibroker
I copied a wscript source code file from an earlier posting that used 
the automation features of Amibroker, and I tried to execute the same 
wscript file without success. I can automate MS Excel from an 
external app but I cannot do the same for Amibroker and I think the 
first line of code is where i fail, "Amibroker = new ActiveXObject
("Broker.Application");" . Am I missing a *.dll file somewhere ? In 
VB I usually have to add a reference to a *.tlb file or a local 
Active X object. Also is it possible to automate Amibroker from a VB 
app ? The Wscript file I tried to execute is typed as :
<job id="main">
	<script language="JScript">
		Amibroker = new ActiveXObject("Broker.Application");
		WScript.Echo( "loading database");
		try
		{ Amibroker.LoadDatabase("C:\\Program 
Files\\AmiBroker\\DataBid"); }
		catch ( e )
		{ WScript.Echo( "error loading" + e ); }
		
		WScript.Echo( "importing");
		try
		{ Amibroker.Import(0,"C:\Documents and 
Settings\Smith\My Documents\Ticker 
Data\AWA\Bid\AWA0811.txt", "C:\\Program 
Files\\AmiBroker\\Formats\\default.format"); }
		catch ( e )
		{ WScript.Echo( "error importing" ); }
		
		WScript.Echo( "refreshing");
		Amibroker.RefreshAll();
		
		WScript.Echo("saving");
		Amibroker.SaveDatabase();
		
		WScript.Echo( "done");
	</script>
	
</job>
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
 |