How to Forward Incoming Messages to External Application
This sample demonstrates how to forward incoming messages to external applications
using the Info service.
File ShowMessage.vbs used in this sample is located in the folder:
C:\Program Files\CodeSegment\SMS Studio\Samples\InfoService
This script receives the text and
the phone number of the sender of the incoming message and displays a message
box.
The contents of the ShowMessage.vbs file:
if WScript.Arguments.Count = 2 then
SenderPhone = WScript.Arguments(0)
Text = WScript.Arguments(1)
MsgBox "From: " & SenderPhone & vbCr & "Text: " & Text, vbInformation, "SMS Studio Show Message Sample"
WScript.Quit(0)
else
MsgBox "Error: Wrong number of arguments.", vbCritical, "SMS Studio Show Message Sample"
WScript.Quit(1)
end if
How to run this sample
- Click the New button on the main toolbar and select the Info service option in the New Service dialog.
- Click the Setup button on the main toolbar to display the Info Setup dialog.
- In the General tab of the Info Setup dialog click the Add button to display the Add Rule dialog.
- In the General tab of the Add Rule dialog enter the following parameters:
Name: Show Message
Pattern: *
Action: Execute external application
- In the Execute tab of the Add Rule dialog enter the following parameters:
External application: ShowMessage.vbs - use the selection button ( ... ) to locate and select the external application.
Application parameters:
"%MsgFromPhone%" "%MsgText%"
- Click the Add button to close the Add Rule dialog.
- Click the OK button to close the Info Setup dialog.
- Click the Start
button on the main toolbar to start the Info service.
- Use Tools / Receive Message option in the main menu to
display the Receive Message dialog. Fill in the Phone and
Text fields and click the Receive button. The Info
service will receive this message and run the ShowMessage.vbs application which will display a message
box with the information about the received message.
Related topics
Named Pipe