experience with VBScript on Vista needed
revdev at pdslabs.net
Tue Jun 9 00:19:46 CDT 2009
Have you tried "putting" tVBS just before the "do" to see what the VB
script looks like? You might see some obvious thing malformed. Or is it
possible there's a permissions issue? Stranger things have happened. I
just automatically suspect permissions if the script is correct. Is your
UAC turned off?
Jim Bufalini wrote:
> 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\")")
>> put tVBS & cr & "WshShell.AppActivate" && quote & pTitle & quote into
>> 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
> put tVBS & CR & format("WshShell.AppActivate \"Internet Explorer\")") into
> 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
Professional Software Development
More information about the use-livecode