Page 1 of 1

Is the an API for ANT?

Posted: 2007-09-11 03:22:49
by WannaTheater
Hi, Thanks for the great program!

I am in process of writing several scripts to aid in my "media management." Currently I MANUALLY export several fields from my ANT DB to a text file (call this DATA.TXT). I then open DATA.TXT from within a Visual Basic script for some further processing.

I would like the VB script to initiate the generation of DATA.TXT, instead of manually starting ANT, and manually exporting every time the ANT DB is changed.

I can think of a couple of ways to do this, but perhaps there is an easier way?

1) Write my own "Read" procedure for the underlying ANT binary database- bad option :cry:
2) Write my own parser to extract the required fields from the XML representation of the ANT database- better option, but still bad :??:
3) Is there some kind of API that I can call from within VB to start ANT, open a specified database, then export the required fields to a specified file?
4) Are there any command line utilities already written which can be used to open a database, and export the required fields?

(I am comparing this to MS Excel, in which I can start the application, open a file, process the file, then save the file.... all from within an external VB script)

Thank You!

Posted: 2007-09-11 08:52:33
by antp
Hi,
Sorry, currently AMC does not have such possibilities.
Only solution for controlling AMC like you can do with Excel would be to use a tool made for that, like "AutoIt" (one of the names that come to my mind, not sure that it is the right choice, and there may be others).
In a future version I should add command-line options to at least allow exportation.
The binary format is not hard to handle in various programming languages, but maybe that in VBscript it is not very easy, though.

Posted: 2007-09-11 13:29:43
by WannaTheater
Thanks Antoine. I thought about using something like AutoIT, but I cannot see an easy integration into VB. I am pretty new to VB, but I don't think it has powerful read functionality (unlike C/C++) to process/parse a binary. I've only been using it for text files. Probably the easiest way will be for me to convert my Movies.AMC to Movies.XML with linked images, then write a small parser in my VB script to pull out the required fields.

Is there any drawback (performance/stability) to using .XML format with linked images, instead of using the .amc format?

Posted: 2007-09-11 18:49:12
by antp
Actually performances of AMC using linked images (rather than stored images) are better, since it loads all stored images at same time as catalog (and saves them at same time) which may take some time and memory for big catalogs.
Between AMC and XML files there is not much difference for the movie info, as these files are quite small anyway.

Posted: 2007-09-12 00:09:16
by WannaTheater
Thanks. I just thought of another way: I found the AMC2CSV command line utility... I believe I could call this utility from my VBscript, which would create a csv file. I could then control Excel from the VBscript to open the excel file, then delete the columns of the data I DON'T need....

This would evvectively be exporting the fields I DO need :)
I need to play around with this AMC2CSV util.

Posted: 2007-09-12 17:14:57
by antp
I forgot that tool :lol: