Automating Micromine Macro/Script Runs

Andrew Esmaili 9 years ago in General 0
Using Windows Task Scheduler for Automating Micromine

The Windows Task Scheduler allows users to schedule automated tasks that perform actions at a specific time or when a certain event occurs. A user can run, disable, modify, and delete tasks that have been created and stored in the scheduler library. This tool can used in conjunction with Micromine to automate routine tasks such as running a macro on a daily basis.

Image 394

Below is the process that a schedule Micromine user can undertake to open and automatically run a macro or python script by undertaking the following steps:

  • 1.
    Locate the Task Scheduler by clicking on the Windows START button, searching for Task Scheduler in the Search window and open it once it is found.
  • 2.
    Navigate to Action | Create Task to open the Create Task dialog where the properties associated with the task are defined.
  • 3.
    Under the General tab, populate the Task Name and Description fields . This tab also provides other options such as which user account is used and which versions of window the task is configured for.
  • Image 396
  • 4.
    Navigate to the Triggers tab and click on the New button to specify the schedule for a task. 
  • Image 397
  • 5.
    Navigate to the Actions tab then click on the New button to define an action.
  • 6.
    Click on the Action dropdown menu and select Start a Program from the list.
  • 7.
    Now populate the Program/script window with the path for the Micromine executable on your machine. For example : "C:\Program Files (x86)\Micromine 2014\mmwin.exe"
  • 8.
    To run a macro within a given project populate the Add Argument window with: -project "projectname" -macro "macro name.mcr".
  • 9.
    Once the argument has been defined you can specify other special conditions or settings before clicking on the OK button of the Create Task dialog to complete the process.
  • 10.
    To test the scheduled task once it is created you can right click on it from the task list within the Task Schedule Library and select Run.
  • Image 395
The same process can be used for scripts so long as the Argument is defined correctly.