Genesys CTI User Forum

Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: Stefano on September 09, 2008, 03:09:19 PM

Title: to create a log file with thresholds
Post by: Stefano on September 09, 2008, 03:09:19 PM
hello, i am trying to create a log file (.txt) from a threshold applyed to the statistics objects, but it seems that the basic instructions don't work (open "Path" for append as #1: ecc. ecc.). Someone can help me?

thanks
Title: Re: to create a log file with thresholds
Post by: cavagnaro on September 09, 2008, 08:01:51 PM
You can search on google for tons of vb script examples.
Title: Re: to create a log file with thresholds
Post by: S on September 10, 2008, 05:51:33 PM
This one worked for me.
But make sure TestCCPulse.txt already exists.



Dim objFSO, objTextFile
Dim sLogName
sLogName="C:\TestCCPulse.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile(sLogName,8,True)
objTextFile.Write (Date())
objTextFile.Write (" ")
objTextFile.Write (Time())
objTextFile.Write (" ")
objTextFile.Write ("Agent ")
objTextFile.Write (Threshold.CFGObjectID)
objTextFile.Write (" There are ")
objTextFile.Write (Threshold.StatValue)
objTextFile.Write (" Agents logged in now.")
objTextFile.WriteBlankLines(2)
CCPulseNotifier.SetColor( Color.White )
objTextFile.Write (Date())
objTextFile.Write (" ")
objTextFile.Write (Time())
objTextFile.Write (" ")
objTextFile.Write ("Agent ")
objTextFile.Write (Threshold.CFGObjectID)
objTextFile.Write (" There are ")
objTextFile.Write (Threshold.StatValue)
objTextFile.Write (" Agents logged in now.")
objTextFile.WriteBlankLines(2)
objTextFile.Close
Set objFSO = Nothing