The following section gives an overview about the powerful HP Chemstation macro language. Its popularity is based on the open concept and simplicity (like BASIC). You can read almost of the code and learn from it. If you want to write your own code you should download the ChemStation Macro Editor (Macropad) from Niels Waleson and the macro debugger.
If you are running the LC(UV-VIS) Chemstation read the Agilent ChemStation for UV-visible Spectroscopy - Macro Programming Guide [PDF]. For other revisions you should checkout the 450 page monster Macro Programming Guide [PDF].
If you want to program the Agilent ChemStation for GC-MSD (G1034C ,G1032C, G1701AA, G1710,G1701BA) you should do a quick search for all help files in your \hpchem\msexe\ directory (macros.hlp or hpenvda.hlp) they cover most of the implemented commands.
For questions you can visit ChemUserWorld or sci.chem.analytical or sci.techniques.mass-spec. You can find an example macro for converting Chemstation data to ASCII here: HP2ASCII.
You will find a short summary of macro commands for the GC Chemstation here: