[Closed] Seperate .MS with .MCR use "on execute do" or not?
I’ve only recently started separating my macroscripts into an .MS file that has the actual code in it, and a small .MCR file that defines the macro name, category, tooltip etc and does a filein for the MS.
I’ve seen scripts that use:
on execute do filein blahblah.ms
And I’ve seen scripts that skip the
on execute do
and just go straight to the filein.
Does anyone know if there’s any actual difference between the two? I can’t see any reference in the help file to using the on execute do filein way of doing things.
Cheers,
Cg.
for a simple macro where you are only executing code there is no difference but you should use on execute when you are using the isChecked / isEnabled / isVisible events
When on execute handler is used, only that part of macroscript gets executed when it’s triggered so you can define some of your locals, rollouts and stuff that doesn’t change in the macroscript body and only create/destroy dialog (for example) in the on execute scope. On the other hand, if you only do fileIn, it doesn’t matter at all.