The CallGuide.custom file allows rostrvm CallGuide functionality to be extended. The CallGuide.custom file is a VB Script file that is combined with the CallGuide.advscr script to form the CallGuide script application.
The CallGuide script application is loaded and run within the Microsoft Script Engine that is part of the rostrvm AdVisor application. VB script written within the CallGuide.custom has full access to functionality provided by the Microsoft VB Script v5.6 runtime engine.
The AdVisor application and the CallGuide.advscr script file expose various functions that can be called from the CallGuide.custom file. These functions include utilities providing access to the rostrvm database using SQL to modifying the AdVisor's toolbar and menu.
The following sections describe:
• | how to extend the AdVisor toolbar functions; |
• | the CallGuide API functions; |
• | the CallGuide events; |
• | the AdVisor events; |
• | how 3rd party library events are handled. |
• | integrating CallGuide with 3rd party applications using SendKeys. |
• | using AutoIT as an alternative to SendKeys. |
The Advisor toolbar systems consists of two main toolbars (standard toolbar and menu), and a third pop-up menu that is used by the system tray and small footprint Advisor.
The AdVisor provides a series of functions that can be called from CallGuide.custom that allow the AdVisor’s Toolbar and menu to be modified. New button and menu options may be added and exiting buttons and menus may be modified.
These functions are accessed from the ADVISOR_APP_WINDOW object. The diagram below shows the Advisor Toolbar interface.
Tools.Add()
Adds a new tool to the collection of available toolbar tools source
Parameter |
Data Type |
Description |
name |
Variant(string) – In |
The name of the new custom tool. |
type |
Variant(Int) – In |
The type of tool to add: 0 - TOOL_BUTTON, 1 - TOOL_STATE_BUTTON, 2 - TOOL_DROP_DOWN, 3 - TOOL_DROP_DOWN_STATE_BUTTON, 4 - TOOL_COMBO_BOX, 5 - TOOL_EDIT, 6 - TOOL_LABEL, 7 - TOOL_MENU, 8 - TOOL_SEPERATOR. |
return value |
Variant(object) – out |
Tool object reference. |
Tools.Tool()
Parameter |
Data Type |
Description |
name |
Variant(string) – In |
The name of the tool to be returned. |
return value |
Variant(object) – out |
Tool object reference. |
Toolbars.Toolbar()
Parameter |
Data Type |
Description |
Name |
Variant(string) – In |
The name of the AdVisor toolbar to return. This can be “AdVisorToolbar” for the toolbar and “AdVisorMenuBar” for the menubar. |
return value |
Variant(object) – out |
Toolbar object reference. |
Popups.Add()
Parameter |
Data Type |
Description |
Name |
Variant(string) – In |
The name of the AdVisor popup menu to return. |
Menu |
Variant(string) – In |
The name of the pop-up in which to add the new menu item. This can be either: “Root”, “Options” or “Windows”. |
return value |
Variant(object) – out |
Popup menu item object reference. |
Popups.Popup()
Parameter |
Data Type |
Description |
Name |
Variant(string) – In |
The name of the AdVisor popup menu to return. |
return value |
Variant(object) – out |
Popup menu item object reference. |
Loading images resources
Images resources including bitmaps and icons may be loaded and assigned to new toolbar buttons and menu options. All files with a file extension of .ico and .bmp that reside in the same folders as the CallGuide.custom file for a given CallGuide profile are loaded by the Advisor on start-up and are accessible from the CallGuide.custom file.
Function |
Description |
Advisor.Icons.Item("MyIcon.ico")
|
Returns a local file reference to the icon file “MyIcon.ico”. |
Advisor.Bitmaps.Item("MyBitmap.bmp") |
Returns a local file reference to the bitmap file “MyBitmap.bmp”. |
Knowing the local file reference, a VB LoadPicture() call can be used to load the picture resource.
Adding a new button to the AdVisor Toolbar
The following examples add a new button with a picture to the toolbar. A new menu item is also added to the Call menu.
First we need to create a new button tool:
Set m_MyButton = ADVISOR_APP_WINDOW.Tools.Add("MyButton", TOOL_BUTTON)
We can then set any button properties such as its picture and tooltip text:
m_MyButton.Picture = LoadPicture(Advisor.Icons.Item("MyIcon.ico"))
m_MyButton.ToolTipText = "This is my button"
We can then make it visible:
m_MyButton.Visible = True
Now we can add the button to the Advisor toolbar:
Set m_AdvisorAppToolbar = ADVISOR_APP_WINDOW.Toolbars.Toolbar("AdVisorToolbar")
m_AdvisorAppToolbar.Tools.Add "MyButton", TOOL_BUTTON, MY_BUTTON_POSITION
Adding a new item to the Advisor Menubar
We can also create a new menu option:
Set m_MyMenuOption = ADVISOR_APP_WINDOW.Tools.Add("MyMenuItem", TOOL_LABEL)
m_MyMenuOption.Name = "&My Menu Option"
Add the menu option to the AdVisor Call menu:
Set m_AdvisorAppMenubar = ADVISOR_APP_WINDOW.Toolbars.Toolbar("AdVisorMenuBar")
m_AdvisorAppMenubar.Tools.Tool("mnuCall").Menu.Tools.Add("MyMenuItem")
The table below details the id for each of the drop down menus that a new menu option may be added.
AdVisor menu id |
Description |
mnuFile |
File menu |
mnuState |
Agent State menu |
mnuCall |
Call menu |
mnuWindow |
Window menu |
mnuOptions |
Options menu |
mnuHelp |
Help menu |
Hiding an existing AdVisor toolbar button
The following example disables and hides the Clear Call button on both the menu and toolbar.
ADVISOR_APP_WINDOW.Tools.Tool("toolClearCall").SetPropertyReadOnly PROP_ENABLED
ADVISOR_APP_WINDOW.Tools.Tool("toolClearCall").ForceEnabled = False
ADVISOR_APP_WINDOW.Tools.Tool("mnuClearCall").SetPropertyReadOnly PROP_VISIBLE
ADVISOR_APP_WINDOW.Tools.Tool("mnuClearCall").ForceVisible = False
The CallGuide.advscr file defines a number of functions that can be called from the CallGuide.custom script file.
AddCLIPElement
This function will register interest in a rostrvm CLIPElement. This call should be made from the Initialise() event handler within the CallGuide.custom file.
Parameter |
Data Type |
Description |
Name |
Variant(string) – In |
Name of rostrvm CLIPboard element to register interest in. |
Callback
This function will pop the AdVisor callback window.
Parameter |
Data Type |
Description |
None. |
- |
- |
CLIPElement
This function will return the value of the specified rostrvm CLIPboard element.
Parameter |
Data Type |
Description |
ElementName |
Variant(string) – In |
The name of rostrvm CLIPboard element to return. |
Return value |
Variant(int) – Out |
CLIPboard element value. |
DebugPrint
This function will output a debug log message to the rostrvm system control log file and local Advisor log file (enabled by adding -debuglog to the Advisor command line).
Parameter |
Data Type |
Description |
Message |
Variant(string) – In |
Debug message to output to log file. |
DisableAuditLog
This function will disable rostrvm audit log.
Parameter |
Data Type |
Description |
None. |
- |
- |
EnableAuditLog
This function will enable rostrvm audit log.
Parameter |
Data Type |
Description |
None. |
- |
- |
ErrorPrint
This function will output an error log message to the rostrvm system control log file and local Advisor log file (enabled by adding -debuglog to the Advisor command line).
Parameter |
Data Type |
Description |
Message |
Variant(string) – In |
Error message to output to log file. |
DbDirectQuery
This function will issue an sql query to the rostrvm CONFIGURE database.
Parameter |
Data Type |
Description |
Query. |
Variant(string) – In |
SQL query to perform on rostrvm CONFIGURE database. |
Return value |
Variant(object) – Out |
object containing results from query |
GoReady
This function will request the agent move to the Ready state. If the agent is currently busy on a call, the request will be made once the CallGuide script has finished.
Parameter |
Data Type |
Description |
None. |
- |
- |
GoNotReady
This function will request the agent move to the Not Ready state. If the agent is currently busy on a call, the request will be made once the CallGuide script has finished.
Parameter |
Data Type |
Description |
None. |
- |
- |
GoNotReadyEx
This function will request the agent move to the Not Ready state. If the agent is currently busy on a call, the request will be made once the CallGuide script has finished.
Parameter |
Data Type |
Description |
Reason |
Variant(int) - In |
The reason for the not ready request. |
InfoPrint
This function will output an information log message to the rostrvm system control log file and local Advisor log file (enabled by adding -debuglog to the Advisor command line).
Parameter |
Data Type |
Description |
Message |
Variant(string) – In |
Information message to output to log file. |
Logoff
This function will log the agent off the switch. If the agent is currently busy on a call, the request will be made once the CallGuide script has finished.
Parameter |
Data Type |
Description |
None. |
- |
- |
MakeCall
This function will make an outbound call. If there are no current calls at the agent position a make call is performed. If the agent already has a call, a consultation or re-queue call is made dependant on the ConsultType parameter.
Parameter |
Data Type |
Description |
Destination |
Variant(string) – In |
The destination to make the call to. |
ConsultType |
Variant(int) – In |
0 - requeue, 1 - consultation for transfer, 2 - consultation for conference. |
MakeCallEx
This function will make an outbound call. If there are no current calls at the agent position a make call is performed. If the agent already has a call, a consultation or re-queue call is made dependant on the ConsultType parameter. This function also allows the call class to be specified for the call.
Parameter |
Data Type |
Description |
Destination |
Variant(string) – In |
The destination to make the call to. |
ConsultType |
Variant(int) – In |
0 - requeue, 1 - consultation for transfer, 2 - consultation for conference. |
CallClass |
Variant(int) -In |
The call class id for the call |
MisDirectQuery
This function will issue an sql query to the rostrvm MIS database.
Parameter |
Data Type |
Description |
Query. |
Variant(string) – In |
SQL query to perform on rostrvm MIS database. |
Return value |
Variant(object) – Out |
object containing results from query |
MoveAccount
This function will move the current active account into the specified list.
Parameter |
Data Type |
Description |
DestList |
Variant(string) – In |
The name of the list to move the account to. |
Return value |
Variant(int) – Out |
rostrvm diagnostic result code. 0 - ok, 1 - failed. |
Page_GetValue
This function reads the value of a database bound field.
Parameter |
Data Type |
Description |
frame |
Variant(string) -In |
The html page frame containing the element being read. |
dataSrcName |
Variant(string) – In |
The name of the data source containing the element being read. |
elementName |
Variant(string) – In |
Name of element whose value we are reading. |
Page_Update
This function programmatically updates the value stored in the database for a given database bound field.
Parameter |
Data Type |
Description |
frame |
Variant(string) -In |
The html page frame containing the element being updated. |
dataSrcName |
Variant(string) – In |
The name of the data source containing the element being updated. |
elementName |
Variant(string) – In |
Name of element whose value we are updating. |
elementValue |
Variant(string) – In |
New value |
PersistData_Clear
Clears all persisted data held in the given data source.
Parameter |
Data Type |
Description |
dataSrcName |
Variant(string) – In |
The name of the data source to clear. |
PersistData_DeleteRow
Deletes a row in the in a multi-row data source.
Parameter |
Data Type |
Description |
dataSrcName |
Variant(string) – In |
The name of the data source to delete a row from. |
Index |
Variant(Int) – In |
The index of the row to delete. (0 – first row). |
PersistData_GetValue
This function returns the value of an element within a given persisted data source.
Parameter |
Data Type |
Description |
dataSrcName |
Variant(string) – In |
The name of the data source to get value from. |
rowIndex |
Variant(Index) – In |
Index of row (first row has an index of 0) |
elementName |
Variant(string) – In |
Name of element to retrieve value for. |
PersistData_NewRow
This function appends a new row to a persisted data source.
Parameter |
Data Type |
Description |
dataSrcName |
Variant(string) – In |
The name of the data source to append a new row. |
PersistData_NumRows
This function returns the number of rows in the given persisted data source
Parameter |
Data Type |
Description |
dataSrcName |
Variant(string) – In |
The name of the data source to update a value in. |
return value |
Variant(Int) – Out |
Number of rows contained in persisted data source. |
PersistData_Refresh
The function refreshes the html document view that contains the bound persisted data source.
Parameter |
Data Type |
Description |
dataSrcName |
Variant(string) – In |
The name of the data source to refresh. |
document |
Variant(object) – In |
Object reference of HTML document containing data persisted. |
PersistData_SetPermanent
The function causes the given persistent datasource not to be cleared at the beginning of the next call.
Parameter |
Data Type |
Description |
dataSrcName |
Variant(string) – In |
The name of the data source whose permanent flag is to be modified. |
Permanent |
Variant(bool) – In |
True - do not clear data contained in the specified data source on each new call. False - clear the data contained in the specified data source at the beginning of each call. |
PersistData_Update
This function updates a value within a single row persisted data source.
Parameter |
Data Type |
Description |
dataSrcName |
Variant(string) – In |
The name of the data source to update a value in. |
elementName |
Variant(string) – In |
Name of element whose value we are updating. |
elementValue |
Variant(string) – In |
New value |
PersistData_UpdateRow
This function updates a value within a multi-row persisted data source.
Parameter |
Data Type |
Description |
dataSrcName |
Variant(string) – In |
The name of the data source to update a value in. |
elementName |
Variant(string) – In |
Name of element whose value we are updating. |
elementValue |
Variant(string) – In |
New value |
Index |
Variant(Int) – In |
Row index (the first row has an index of 0) |
RunScript
This function will run a CallGuide script.
Parameter |
Data Type |
Description |
Name |
Variant(string) – In |
Name of script to run. The script start position can be specified with a string suffix (ie. ?PROMPT20) |
ResetHistory |
Variant(bool) - In |
True - reset history buffer. If True all navigation history from parent scripts will be cleared. True would normally only be specified for the first script within a call cycle. |
SelectField
This function will show the given html page in the given document frame and also set focus to the element with the given id.
Parameter |
Data Type |
Description |
Frame |
Variant(string) – In |
The name of frame to show the page in. |
Url |
Variant(string) – In |
The url of the page to navigate to. |
Id |
Variant(string) – In |
The id of the element to set focus to |
SetCLIPElement
This function will update the specified rostrvm CLIPboard element with a new value.
Parameter |
Data Type |
Description |
Element |
Variant(string) – In |
The name of the element to update. |
Val |
Variant(string) – In |
The new element value. |
ShowPage
This function will show the given html page in the given document frame.
Parameter |
Data Type |
Description |
Frame |
Variant(string) – In |
The name of frame to show the page in. |
URL |
Variant(string) – In |
The url of the page to navigate to. |
WarnPrint
This function will output a warning log message to the rostrvm system control log file and local Advisor log file (enabled by adding -debuglog to the Advisor command line).
Parameter |
Data Type |
Description |
Message |
Variant(string) – In |
Warning message to output to log file. |
Microsoft’s VB Script engine natively supports event handlers to be bound to 3rd party library COM events, however rostrvm CallGuide implements its own event handling mechanism using the CallGuide COM Bridge. Both AdVisor and CallGuide call named event handlers within the CallGuide custom file in response to state changes. If the AdVisor or CallGuide script call an event handler within the CallGuide custom file that has not been defined, the event is simply ignored.
The following describes events that are raised by CallGuide.
CallNotAnswered
Called if a script was triggered but the call was not answered.
Parameter |
Data Type |
Description |
None. |
- |
- |
Initialise
Called once CallGuide has loaded but before a connection to rostrvm has been made.
Parameter |
Data Type |
Description |
None. |
- |
- |
Connected
Called once CallGuide has initialised and has connected to rostrvm.
Parameter |
Data Type |
Description |
None. |
- |
- |
PreRunScript
Called once the selected CallGuide prompt file has executed.
Parameter |
Data Type |
Description |
Script |
Variant(string) – In |
Name of prompt script that has executed. |
PostRunScript
Called after the CallGuide script has been completed and the call has been cleared. This handler allows custom logic to written to determine the script that is triggered.
Parameter |
Data Type |
Description |
Script |
Variant(string) – In/Out |
Name of prompt script that has completed. |
CustomInputBox
Allows a custom input dialog box to be created and used by the ActivityCode value collection within the CallGuide script.
Parameter |
Data Type |
Description |
Prompt |
Variant(string) – In |
Input box prompt. |
Caption |
Variant(string) – In |
Input box caption. |
Default |
Variant |
Default value |
CLIPElementDataFilter
Allows a rostrvm CLIPboard element to be modified before displayed by CallGuide. The modified CLIPboard element value should be returned by this function.
Can be used to manipulate a Date format string before display.
Parameter |
Data Type |
Description |
isDeviceClipboard |
Variant(bool) – Out |
True if device CLIPboard is active. |
elementName |
Variant(string) – In |
Name of the CLIPboard element. |
elementValue |
Variant |
CLIPboard element value |
SetCLIPElementDataFilter
Allows a rostrvm CLIPboard element to be modified before it is sent to rostrvm. The modified CLIPboard element value should be returned by this function.
Can be used to manipulate a Date format string before sending to rostrvm.
Parameter |
Data Type |
Description |
isDeviceClipboard |
Variant(bool) – Out |
True if device CLIPboard is active. |
elementName |
Variant(string) – In |
Name of the CLIPboard element. |
elementValue |
Variant |
CLIPboard element value |
WaitingForCall
Advisor has gone Ready and is waiting for the dialler to launch the next call.
Parameter |
Data Type |
Description |
None. |
- |
- |
CallNotAnswered
Advisor has gone Ready and is waiting for the dialler to launch the next call.
Parameter |
Data Type |
Description |
None. |
- |
- |
PreResponse_Click
Called prior to any action taken by CallGuide once a Response is selected.
Parameter |
Data Type |
Description |
Cancel |
Variant(bool) - Out |
If True is returned the Response click is ignored. This handler could by used to validate data capture before allowing the script to move to another prompt. |
PreBack_Click
Called prior to any action taken by CallGuide once BACK is selected.
Parameter |
Data Type |
Description |
Cancel |
Variant(bool) - Out |
If True is returned the BACK click is ignored. This handler could by used to validate data capture before allowing the script to move to back. |
NavigateComplete2
Called once the requested Web page navigation has completed.
Parameter |
Data Type |
Description |
URL |
Variant(string) - In |
The URL that has been navigated to. |
DocumentComplete
Called once the requested Web page navigation has completed.
Parameter |
Data Type |
Description |
URL |
Variant(string) - In |
The URL that has been navigated to. |
TriggerScript
Called prior to the selection of the once the requested Web page navigation has completed.
Parameter |
Data Type |
Description |
URL |
Variant(string) - In |
The URL that has been navigated to. |
PostSendActCodes
Provides a complete list of the activity codes that has been captured by CallGuide once they have sent off to rostrvm.
Parameter |
Data Type |
Description |
NumCodes |
Variant(int) – In |
Number of activity codes collected |
ActCodes |
Variant(string[]) – In |
Array of activity codes collected. |
ActValues |
Variant(string[]) - In |
Array of activity values. |
GetListOfValuesReq
Enables a custom sql query to be used to pre populate an html drop down box. This event handler is called when the html page containing the drop drop down box is loaded.
Parameter |
Data Type |
Description |
Group |
Variant(string) – In |
The items group as specified in the CallGuide html designer. |
Query |
Variant(string) – Out |
The custom sql used to return the list of items. The sql query must specify 3 columns; <description>, <value>, <selected>. |
WebPage_BeforeDialNumber
Called in response to the "Dial Number" option being selected on a CallGuide web page pop-up context menu. This event handler provides the ability to pre-process the number and cancel the request if necessary.
Parameter |
Data Type |
Description |
Num2Dial |
Variant(string) - In/Out |
The number to dial. Can be modified. |
Returns |
Variant(bool) - Out |
True if the Dial Number request is to be cancelled. |
These are events that are raised by the AdVisor application. The events defined below can be caught by defining an event handler routine with correct signature as detailed below.
Advisor_ToolClick_PreChange
This event handler is called prior to an AdVisor toolbar button or menu click being processed.
Parameter |
Data Type |
Description |
Tool |
Variant (object) – In |
Object reference to the tool that has been clicked. |
Event handler result |
Variant(bool) – Out |
If True is returned the default Advisor event handler is not called. |
Using this event handler allows the default button or menu click action to be supplemented or replaced by a custom event handler.
The Tool.ID property identifies the AdVisor toolbar button or menu that has been clicked. Tool ids that are prefixed with “tool” refer to toolbar buttons, tools with an id prefix of “mnu” refer to menu items.
Tool.ID |
AdVisor function |
mnuResetTurret |
Reset Turret |
mnuAgentLogon |
Agent logon |
mnuAgentLogoff |
Agent Logoff |
mnuShutdown |
AdVisor Shutdown requested |
mnuExit |
AdVisor exit requested |
mnuGoReady |
Agent Go Ready |
mnuGoNotReady |
Agent Go Not Ready |
toolGoNotReady |
Agent Go Ready |
mnuAutoAnswer |
Toggle Auto Answer setting |
mnuPopRecentCalls |
Display Recent Calls Window |
mnuAlwaysOnTop |
Always on top option toggled |
mnuMakeCall |
Make an call |
toolMakeCall |
Make a call |
mnuSupervisor |
Make a call to the configured Supervisor number. |
toolSupervisor |
Make a call to the configured Supervisor number. |
mnuRecordCall |
Start call recording. |
toolRecordCall |
Start call recording. |
mnuClearCall |
Clear call on active call slot |
toolClearCall |
Clear call on active call slot |
mnuRequeue |
Requeue call call. |
toolRequeue |
Requeue call call. |
mnuConference |
Conference call. |
toolConference |
Conference call. |
mnuTransfer |
Transfer Call. |
toolTransfer |
Transfer Call. |
mnuClipboardViewer |
Display the Clipboard/Contact viewer window. |
mnuActivityCodes |
Display the Activity Codes window. |
mnuCallAnalysis |
Display the Call History window. |
mnuRecentCalls |
Display the Recent Calls window. |
mnuPersonalWallboard |
Display the Personal Wallboard window |
mnuHelpAbout |
Display the Help About window. |
mnuCallSlot1 |
Call Slot 1 clicked |
toolCallSlot1 |
Call Slot 1 clicked |
mnuCallSlot2 |
Call Slot 2 clicked |
toolCallSlot2 |
Call Slot 2 clicked |
mnuCallSlot3 |
Call Slot 3 clicked |
toolCallSlot3 |
Call Slot 3 clicked |
mnuCallback |
Display Callback window |
toolCallback |
Display Callback window |
mnuSkipCall |
Skip Outbound call |
toolSkipCall |
Skip Outbound call |
mnuDialNow |
Dial Outbound call |
toolDialNow |
Dial Outbound call |
mnuPauseDialling |
Pause Outbound dialling |
toolPauseDialling |
Pause Outbound dialling |
mnuDoNotCall |
Mark account as do not call |
toolDoNotCall |
Mark account as do not call |
toolInitConference |
Initiate Consultation for conference call |
toolInitTransfer |
Initiate Consultation for transfer call |
toolMessageForward |
Forward Instant message |
toolMessageReply |
Reply to Instant message |
toolMessageFinished |
Finish instant message (clear it) |
toolMessageNew |
Create new instant message |
toolEmailForward |
Forward email |
toolEmailReply |
Reply to email |
toolEmailFinished |
Finish email (clear it) |
toolEmailNew |
Create New Email |
Advisor_ToolClick_PostChange
This event handler is called after the default tool click handler has been called.
Parameter |
Data Type |
Description |
Tool |
Variant (object) – In |
Object reference to the tool that has been clicked. |
LoadWallboardDisplayFile
Called when the display of Personal Wallboard has been requested. Allows the display of alternative personal wallboards.
Parameter |
Data Type |
Description |
Return |
Variant(string) |
name of personal wallboard display to load. |
Resize
Called once an AdVisor resize has completed.
Parameter |
Data Type |
Description |
None. |
- |
- |
Terminate
Called when the AdVisor is about to terminate, but before the connection to rostrvm has been disconnected.
Parameter |
Data Type |
Description |
None. |
- |
- |
Handling 3rd Party Library Events
In order to bind to 3rd Party COM Library events we need to provide an event sink to the COM libraries connection point container. The CallGuide COM Bridge which is an integral AdVisor component provides this functionality and can be accessed from the CallGuide custom file. In order to receive 3rd Party COM library events, the COM library must support the IProvideClassInfo2 interface.
The following sequence describes the event monitoring process:
1. | An instance of the COM object is created in the .custom file; |
2. | Instruct the CallGuide COM Bridge to start Monitoring the libraries events; |
3. | The COM Bridge will create a connection point event sink for the requested COM object; |
4. | Any events raised by the COM library will be received by the COM Bridge; |
5. | The COM Bridge will call an event handler within the .custom file. |
The COM Bridge provides two methods that can be called from CallGuide.custom. The first is “Advise” which requests that the COM libraries events be monitored and “Unadvise” which terminates event monitor of the COM Library. Both methods are accessed indirectly through the AdVisor interface exposed to the CallGuide.custom file.
Advise
This function monitors a given COM libraries events.
Parameter |
Data Type |
Description |
Script |
Variant(object) – In |
Self reference to CallGuide.custom script. This is required so the COM Bridge knows where the event handler can be found. |
Library |
Variant(object) – in |
Object reference to the COM library whose events are being monitored. This is the object reference returned from the CreateObject() call. |
EventPrefix |
Variant(string) – In |
The name prefix used in all event handlers for this COM library. For example if the EventPrefix is “MyObj_” and the COM library fires an event called Refresh, then an event handler called MyObj_Refresh will be called within the CallGuide.custom file. |
Returns |
Variant(Int) – Out |
Handle to the COM Bridges event sink for this COM Library. Used when an “Unadvise” is called. |
Unadvise
This function stops event monitoring for a given COM object.
Parameter |
Data Type |
Description |
Handle |
Variant(Int) – In |
Handle to the COM Bridges event sink for COM library in which events are no longer to be monitored. |
The following example shows how to bind an event handler to the AgentStateChangeEx event exposed in the TELEPHONE object of the rostrvm COM Server API.
Private m_Telephone
Private m_TelephoneHdl
Sub MonitorTelEvents()
Set m_Telephone = CreateObject("RostrvmTelephone.RostrvmTelephone")
m_TelephoneHdl = Advisor.EventMonitor.Advise (this, m_Telephone, "RtmTelephone_")
End Sub
Sub RtmTelephone_AgentStateChangeEx(ACDGroups, State, ReasonCode)
End Sub
All variables within VB script have a type of Variant, this includes event handler parameters. When constructing an event handler only the name of the parameters is declared. The number of parameters in the event handler declaration must match the number of parameters the COM library event defines.
The CallGuide application provides a framework that allows elements contained on a web page to be bound.
Integrating CallGuide with 3rd party applications using SendKeys
CallGuide provides the ability to send one or more key strokes to the active window (as if typed on the keyboard). Sending keys strokes provides a simple integration technique allowing rostrvm data such as rostrvm CLIPboard to be passed to a 3rd party application that have no automation interface.
To send key strokes from CallGuide you must first create the SendKeys object, this is done by adding the following code to your CallGuide.custom file.
Private KEYS
Sub Connected()
Set KEYS = CreateObject("RtmSendKeys.SendKeys.1")
End Sub
Next, the application to receive the key strokes must be given keyboard focus using the Activate() command. The Activate() command takes a single string parameter specifying windows title of the application to received keyboard focus.
KEYS.Activate "Notepad" - gives the running notepad application keyboard focus
Key strokes are sent to application using the Send() command. The Send() command takes a single string parameter that specifies the key strokes to send.
KEYS.Send "This is a message from rostrvm CallGuide"
Each key is represented by one or more characters. To specify a single keyboard character, use the character itself. For example, to represent the letter 'a', pass in the string "a" to the method. Naturally to represent a string of characters just pass them in order as "hello".
The following example will send a series of key strokes to the notepad application that is already running.
Sub SendKeys2NotePad()
KEYS.Activate "Notepad"
KEYS.Send "This is a message from rostrvm CallGuide"
End Sub
If you want to send modifier keys such as the SHIFT, ALT, CONTROL or WINKEY keys in addition to normal keys, you might want to use any of the characters defined in Table 3.
Key |
Code |
WINKEY |
@ |
SHIFT |
+ |
CTRL |
^ |
ALT |
% |
For example, if you want to send "A" you usually press Shift+A, which is equivalent to sending these key strokes: "+a" , similarly to send the "~" you would press Shift+` which is equivalent to key strokes "+`" or simply "{TILDE}" (Table 1).
All characters in Table 3 are reserved and have special meaning in addition to the left/right parenthesis/braces.
The parenthesis are used to associate a given modifier or modifiers with a group of characters, for example to send the "HELLO", you would describe as "+(hello)" which informs SendKeys to depress the SHIFT key while sending the following keys group. Whereas the braces are used to enclose any of the keys displayed in Table 1.
Key |
Code |
BACKSPACE |
{BACKSPACE}, {BS}, or {BKSP} |
BREAK |
{BREAK} |
CAPS LOCK |
{CAPSLOCK} |
DEL or DELETE |
{DELETE} or {DEL} |
DOWN ARROW |
{DOWN} |
END |
{END} |
ENTER |
{ENTER} or ~ |
ESC |
{ESC} |
HELP |
{HELP} |
HOME |
{HOME} |
INS or INSERT |
{INS} |
LEFT ARROW |
{LEFT} |
NUM LOCK |
{NUMLOCK} |
PAGE DOWN |
{PGDN} |
PAGE UP |
{PGUP} |
PRINT SCREEN |
{PRTSC} (reserved for future use) |
RIGHT ARROW |
{RIGHT} |
SCROLL LOCK |
{SCROLL} |
TAB |
{TAB} |
UP ARROW |
{UP} |
F1 |
{F1} |
F2 |
{F2} |
F3 |
{F3} |
F4 |
{F4} |
F5 |
{F5} |
F6 |
{F6} |
F7 |
{F7} |
F8 |
{F8} |
F9 |
{F9} |
F10 |
{F10} |
F11 |
{F11} |
F12 |
{F12} |
F13 |
{F13} |
F14 |
{F14} |
F15 |
{F15} |
F16 |
{F16} |
Keypad add |
{ADD} |
Keypad subtract |
{SUBTRACT} |
Keypad multiply |
{MULTIPLY} |
Keypad divide |
{DIVIDE} |
+ |
{PLUS} |
@ |
{AT} |
APPS |
{APPS} |
^ |
{CARET} |
~ |
{TILDE} |
{ } |
{LEFTBRACE}{RIGHTBRACE} |
( ) |
{LEFTPAREN}{RIGHTPAREN} |
Left/Right WINKEY |
{LWIN}{RWIN} |
WINKEY |
{WIN} equivalent to {LWIN} |
In addition to this, there are some special keys that act like commands:
Command Syntax |
Action |
{VKEY X} |
Sends the VKEY of value X. For example, {VKEY 13} is equivalent to VK_RETURN. |
{BEEP X Y}} |
Beeps with a frequency of X and a duration of Y milliseconds. |
{DELAY X} |
Delays sending the next key of X milliseconds. After the delaying the following key, the subsequent keys will not be further delayed unless there is a default delay value (see DELAY=X). Example: {DELAY 1000} <-- delays subsequent key stroke for 1 second. |
{DELAY=X} |
Sets the default delay value to X milliseconds. This will cause every key to be delayed X ms. If a value is already set and you specify {DELAY Y} you will have your following key delay Y ms but the subsequent keys will be delayed X ms. Example: {DELAY=1000} <-- all subsequent keys will be delayed for 1 second. |
{APPACTIVATE WindowTitle} |
Activates an application using its WindowTitle. Very useful if you want to send different keys to different applications. |
Here are some examples:
Keystrokes |
Description |
||||||||||||||||||
{DELAY=50}@rnotepad~hello world%ha |
|
||||||||||||||||||
{delay=100}{appactivate Calculator}{ESC}5*7~{beep 1000 500}^c{appactivate Notepad}^a{DEL}Result of 5*7 is: ^v |
Given that "Calc.exe" and "Notepad.exe" are running:
|
||||||||||||||||||
{DELAY=500}{NUMLOCK}{CAPSLOCK}{SCROLL}{SCROLL}{CAPSLOCK}{NUMLOCK} |
|
||||||||||||||||||
{DELAY=500}% {DOWN 5} |
|
Using AutoIT as an alternative to SendKeys
The AutoIt library can be considered as an enhanced version of the SendKeys library. It provides send keys functionality, mouse movement and window/control manipulation. AutoItX is a 3rd party COM library which can be created and used from CallGuide.
Private AUTOIT
Sub Connected()
Set AUTOIT = CreateObject("AutoItX3.Control")
End Sub
Once created, all the functionality is accessed through the AUTOIT object. The AutoIt library has its own help documentation which is located in the folder \Utilities\AdVisor\AutoItX.chm on the rostrvm install CD.