By Tim on Thursday, August 12, 2004 - 08:21 am:

Anyone know if it is possible to get a ChemStation macro attached to the Start button, or that would run whenever a sequence is started?

I've got one setup at the moment (it puts up a series of prompts for the user to check various things before their run goes any further). I've attached it as a pre-run macro in the Method, with a variable that is updated when it runs for the first time, so it doesn't run for every injection. Trouble is, this means I have to add it to every ChemStation method we have and also find some way of resetting the variable at the end of a run.

Any assistance would be appreciated.

Tim

-------------------------------------------------------------------------------------------------------
By Consumer Products Guy on Thursday, August 12, 2004 - 09:11 am:

OK, here's what I'd consider, but I'm not a computer guy (I'm a Consumer Products Guy!). Make up a dummy Method, say 0.1 minutes duration, with no injection; for this, include in the Method a Post-Run Macro Command. Put the dummy Method as first line in the sequence (one injection of nothing); this way the Macro would only run once, when the first dummy run has completed.

-------------------------------------------------------------------------------------------------------
By K.H.W. on Monday, August 16, 2004 - 12:35 am:

Yes, it is possible. You have to modify the hook-table and then you can have macros before or after the sequence and even before or after each run. We have a pre_seq macro to initialize files, a post_run macro for data transfer to that file and finally a post_seq macro for generating a custom report.
This should install the hook for the pre_seq macro, which is called usr_PreSeq:

! If the entry is not already made before it will be done here
If RowByText(Hook[1],"PreSeq",,"Command","i=","usr_PreSeq") = -1
SetHook "PreSeq","usr_PreSeq"
Print "PreSeq Hook usr_PreSeq installed"
EndIf