experience with VBScript on Vista needed

Phil Davis revdev at pdslabs.net
Tue Jun 9 01:19:46 EDT 2009


Hi Jim,

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?

Phil Davis



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\")")
>> 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

-- 
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.net




More information about the use-livecode mailing list