experience with VBScript on Vista needed
Jim Bufalini
jim at visitrieve.com
Tue Jun 9 03:08:32 EDT 2009
Hi Phil,
> Have you tried "putting" tVBS just before the "do" to see what the VB
> script looks like?
No, but I had put in a breakpoint. ;-) The script looked fine. And, as I
said, suspecting line endings, I tried CRLF, etc.
> 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?
No, it's on, but this script doesn't write to disk and is pretty innocuous
(it just brings IE to front). I actually started testing a third party DLL
written in VB that has many, many methods that I wanted to experiment with
and the manufacturer had given examples in calling it from vbscript. The
examples run from disk but when I tried from Rev 3.5 I got the execution
error. So, I backed through different versions of Rev and then decided to
try something basic like this two line script that doesn't use a DLL's
methods.
Just now, to eliminate the UAC factor, I moved the stack (which is a new
stack with one button with this script in it) to XP SP2. There is a UAC on
XP SP2, but I have never seen it interfere with anything. Ran under Rev 3.5.
Same error.
The complete code (double spaced so it hopefully doesn't all run into one
line) is:
ON mouseUp pMouseBtnNo
VBS_AppActivate "Internet Explorer"
END mouseUp
----------
ON VBS_AppActivate pTitle
local tVBS, tResult
-----
put format("set WshShell = WScript.CreateObject(\"WScript.Shell\")")
into tVBS
put tVBS & CR & format("WshShell.AppActivate \"Internet Explorer\")") &
CR into tVBS -- Hardcoded
breakpoint
do tVBS as "VBScript"
put the result into tResult
IF tResult <> "" THEN put "Error:" && tResult
END VBS_AppActivate
tResult = *Error: execution error*
Aloha from Hawaii,
Jim Bufalini
More information about the use-livecode
mailing list