13-03-2016 05:58 AM
How can I trigger a macro to run at startup of MEGA?
Solved! Go to Solution.
15-03-2016 11:16 PM - edited 15-03-2016 11:17 PM
Hello,
There is a way that works for me and that you could try : explore the "Repository" metaclass, and "Right clic > New" on the "Commands" folder.
Choose "MetaCommand Manager". (name it "atMegaStart" for example)
In the properties of this new metaCommand, go in the "Setup" tab and create a new macro (that you can also name "atMegaStart".
In this macro, create your sub (and guess what... you can name it "atMegaStart"... 🙂 and call it :
Sub atMegaStart() <your code to do whatever you want at startup> End Sub atMegaStart 'call your sub
Exit MEGA (dispatch your update), and translate/compile your metamodel.
Your macro should now be trigered at startup.
Regards
Lionel
PS : this is for an Hopex version. For a 2009 version, just right click on the "MetaCommand" folder when you explore your "Repository" metaclass, and create a new one (no disctinction between metacommand Item & metacommand manager). Then create your macro the same way as for MEGA Hopex.
14-03-2016 11:23 AM
Hello RamiGh
There is no standard feature for this
It is common to configure a MetaCommand for MetaClass 'Repository'. The associated macro implements CmdCheck and/or CmdInit. This macro is triggered on most situations when click on the menu 'File' in Windows Front-End
Note that this code is not fully reliable. It cannot be assumed that the macro is triggered each time a private workspace is initialized.
See http://community.mega.com/t5/custom/page/page-id/mega-kb-solution?sid=501D00000012kPrIAI