Automatically run an AP2700 macro using runpro

Created on 2008-12-12 22:01:00

Question:   I have a final test macro that calls several other macros, and I would like it to start running automatically as soon as it is opened.


The easiest way to automatically run a macro (formerly called “procedure” in APWin) when it is opened is to append a switch command onto a desktop shortcut.

  1. Create a generic shortcut to your AP control software.
  2. Click the shortcut icon, select “Properties”, then the “Shortcut” tab.
  3. The program file location should appear in the “Target” line.  For example, using AP2700:  “C:Program FilesAudio PrecisionAP2700AP2700.exe”
  4. To open with a macro running, add: 
    /RUNPRO “pathprocedurename.apb”. 
  5. The command line now looks like:
    “C:Program FilesAudio PrecisionAP2700AP2700.exe” /RUNPRO “pathprocedurename.apb”

 /RUNPRO is the switch that starts AP2700 with the macro running.  Note the space before the “/”.

Replace “procedurename.apb” with the full path and file name of the macro you want to run.  Quotes are required if long file names or spaces exist in the path or filename.  Ex.: “c:apwinIntervuMenu.APB”
If any other “/” switches are to be used, then attach them to the end of the “Target” line.

You should rename the shortcut so it is easy to understand.  If you don’t wish to use the standard AP2700 icon, you may choose another using the “Change Icon” button in the shortcut properties.

To load the procedure at startup but NOT run it, simply specify the path and file name after AP2700.exe without the /RUNPRO switch.

There is an AP Basic command for making the macro editor invisible (often included in macros):
AP.Application.VisibleMacroEditor(True or False)

There is also a command for making ALL of APWIN invisible – but use with Caution!
AP.Application.Visible = (True or False)
You will have to close APWIN and reopen it to make it visible again, unless code is included in the procedure to return visibility. Use the task manager (Ctrl-Alt-Del) to see a list of running programs.