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.
Sub IsthisaPCBFile
Set Board = PCBServer.GetCurrentPCBBoard
If Board is Nothing Then
ShowMessage ("This is not a PCB file!")
Else
ShowMessage ("This is a PCB file!")
End I
End Sub
If a pcb file isn't active in Altium then
Else if a PCB file is active
http://www.tdpcb.com/