Most of the scripts will be for the PCB editor, so I need to check and make sure when I run a script it's actully being run in a PCB file. Access the PCBServer to get things started.
Set Board = PCBServer.GetCurrentPCBBoard
If Board is Nothing Then
ShowMessage ("This is not a PCB file!")
ShowMessage ("This is a PCB file!")
If a pcb file isn't active in Altium then