experience with VBScript on Vista needed

Jim Bufalini jim at visitrieve.com
Mon Jun 8 22:50:59 EDT 2009


Ken Ray wrote:
 
> Here's how it would be done in Rev 2.9+:
> 
> on VBS_AppActivate pTitle
>   put format("set WshShell = WScript.CreateObject(\"WScript.Shell\")")
> into
> tVBS
>   put tVBS & cr & "WshShell.AppActivate" && quote & pTitle & quote into
> tVBS
>   put tVBS & cr & "result = Err.number" into tVBS
>   do tVBS as "VBScript"
>   put the result into tResult
>   if there is a file tVBSPath then
>     send "delete file" && quote & tVBSPath & quote to me in 1 second
>   end if
>   if tResult <> "" then return "Error: " & tResult
> end VBS_AppActivate

Hi Ken,

After you gave this answer to Tiemo about a week or so ago, I decided to
play with running some vbscript out of rev 2.9+. The only thing I get is
"execution error." I tried your above script and get the error and then
reduced it down to two hard coded lines:

put format("set WshShell = WScript.CreateObject(\"WScript.Shell\")") into
tVBS
put tVBS & CR & format("WshShell.AppActivate \"Internet Explorer\")") into
tVBS
do tVBS as "VBScript"

I tried CRLF instead of CR (thinking maybe it was a line ending issue), put
one at the end of the second line, etc. No matter what I do I get the
execution error. IE is running and, of course, clicking on a file with these
same two lines and .vbs extension runs without error and brings IE to front.


What's the trick? ;-) Testing on Vista.

Aloha from Hawaii,

Jim Bufalini








More information about the use-livecode mailing list