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.
How to run this sample
Source code
The contents of the ShowMessage.vbs file:
'-------------------------------------------------------------------------------------------------------------------------------
' This script demonstrates receiving parameters from the Info service
' by displaying a simple message box containing supplied arguments.
' WARNING: Error checking omitted for clarity.
'
' Use the following application parameters in the Info Rule dialog:
' "%MsgFrom%" "%MsgText%"
'-------------------------------------------------------------------------------------------------------------------------------
if WScript.Arguments.Count = 2 then
' Collect arguments
SenderPhone = WScript.Arguments(0) ' Sender phone
Text = WScript.Arguments(1) ' Message text
MsgBox "From: " & SenderPhone & vbCr & "Text: " & Text, vbInformation, "SMS Studio Show Message Sample"
WScript.Quit(0) ' Success
else
MsgBox "Error: Wrong number of arguments.", vbCritical, "SMS Studio Show Message Sample"
WScript.Quit(1) ' Error
end if
'-------------------------------------------------------------------------------------------------------------------------------
' Copyright (c) 2002-2009 CodeSegment. All rights reserved. http://www.codesegment.com/
'-------------------------------------------------------------------------------------------------------------------------------
| Copyright © 2002-2010 CodeSegment. All rights reserved. |