
Scripting.DontExit = True
Set objRegEx = CreateObject("VBScript.RegExp")
objRegEx.Global = True
objRegEx.Pattern = "NSETemp" 'Symbol has NSETemp in iCDBDir name


Sub CheckIfSymbolOrSchematic()
	tkyiCDBDir = GetProjectData.iCDBDir
	Set colMatches = objRegEx.Execute(tkyiCDBDir)
	
	If colMatches.Count > 0 Then
		'MsgBox "This is the symbol editor " &vbCRLF & tkyiCDBDir
		'Put your symbol automation code in here
	Else
		'MsgBox "This is the schematic editor " &vbCRLF & tkyiCDBDir
		'Put your schematic automation code in here
	End If
End Sub

i = 0
Sub Application_ActivateView()
	'For some reason this is performed multiple times as a default. That is why i counter is in use.
	If i < 1 Then
		CheckIfSymbolOrSchematic()
		i = i + 1
	End If
End Sub