Jump to content
Macro Express Forums

External Script - Advance Scnario

Recommended Posts

Here's another Question on the board :)


I've capture certain info by using object in IE and stored them in a External script (ES) variable.

Dim IE
Dim URLFound
Dim ObjORS
Dim fln
Call Look_For_URL
If URLFound = True Then
                IE.Visible = True
                fln = IE.document.getElementById("ETSMaster_MainContentPlaceHolder_ETSHeader_pnlHeaderInfo_hypWandFLN").innerHTML
                Caseid = IE.document.getElementById("ETSMaster_MainContentPlaceHolder_ETSHeader_pnlHeaderInfo_lblCaseID").innerHTML
                date = IE.document.getElementById("ETSMaster_MainContentPlaceHolder_ETSHeader_pnlHeaderInfo_lblCaseID").innerHTML
                Status = IE.document.getElementById("ETSMaster_MainContentPlaceHolder_ETSHeader_pnlHeaderInfo_lblCaseID").innerHTML
                Wscript.Echo fln
                Wscript.Echo Caseid
End If

Above script will return value in a variable %Result%. When i call %Result% it will show the values which i've called in script through Wscript.echo command. My question : Is there any way i can use the able values captured in another External script. I'm creating a new e-mail via ES option and want to pass the values retrieved from %Result%.


'Script from Body of the mail.


strMsg = "Case id : " %Result%

"FLN # " %Result%


objMail.body = strMsg


Link to comment
Share on other sites

The above script will return all the values which i've called in %Result% through Wscript.Echo command(i.e. caseid and fln). Does this means in order to print each value seperatly i need to capture each value in a different variable.


Wscript.Echo caseid will be retured in %Result%

Wscript.Echo fln will be retured in %Result1%


or is there a way through which we can retreive all the values seperatly.

Link to comment
Share on other sites

One can only pass one variable back thru the External Scripts command's variable feature. But you could stuff more thru there if you want. EG you could make a long string and separate them all with a delimiter and then use the Split command. EG "Tom,Dick,Harry" and split on comma. Or I often will use the registry instead to pass the variables.

Link to comment
Share on other sites

It's really so simple there's no point. http://www.robvanderwoude.com/vbstech_registry_wshshell.php

I still can't create a link so I had to paste the URL above. But that looks like a good example of how to write to the registry in a VBScript. Also I recommend you write to HKCU and make your own key under Software. I do recommend that you wipe out the values prior to executing your external script to ensure your values are from the recent run and not a previous one.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...