TIP: Click on subject to list as thread! ANSI
echo: nthelp
to: Frank Haber
from: John Cuccia
date: 2003-05-14 18:49:50
subject: Re: Scripting IE6

From: John Cuccia 

Here's a VBScript I use to launch  Agent in a scheduled task and download
messages, you should be able to get it to press IE keys, don't know about
specifying the style sheet.  Watch out for line wrap, I see that the
"Set ofLog" line wraps while composing, I don't know how it will
turn out when posted.

===============
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8

Dim wmi, wmiprocess, wmiprocesses
Dim oSh, oFs, ofLog
Dim i

Set oSh = WScript.CreateObject("WScript.Shell") Set oFs =
CreateObject("Scripting.FileSystemObject") Set ofLog =
ofs.OpenTextFile("c:\program _
files\scripts\Logs\Agent.log",ForAppending,TRUE)

ofLog.WriteLine(Now & ": Job Agent started") Set wmi =
GetObject("Winmgmts:")
If Err.Number  0 Then
        msgbox "Error Number " + cstr(Err.Number) + ":
" + Err.Description
End If

Set wmiprocesses = wmi.InstancesOf("Win32_Process") If Err.Number
 0 Then
   msgbox "Error Number " + cstr(Err.Number) + ": " +
Err.Description
End If
'WScript.Echo cstr(wmiprocesses.Count)

i = 0

For each wmiprocess in wmiprocesses
   If UCase(wmiprocess.Name) = "AGENT.EXE" Then
        ofLog.WriteLine(Now & ": Agent is already running, exiting")
                i = 1
                Exit For
        End If
Next

If i = 0 Then  'No Agent running, start it
        ofLog.WriteLine(Now & ": Starting Agent and downloading
messages")
        oSh.Run "C:\Progra~1\Agent\agent.exe c:\progra~1\agent\barktopus"
        WScript.Sleep 100
        oSh.AppActivate "Agent"
        WScript.Sleep 100
        oSh.SendKeys "%O"
        WScript.Sleep 500
        oSh.SendKeys "N"
        WScript.Sleep 600000
        oSh.SendKeys "%F"
        WScript.Sleep 500
        oSh.SendKeys "X"
        WScript.Sleep 10000
End If

ofLog.WriteLine(Now & ": Job Agent complete") ofLog.WriteBlankLines(1)
ofLog.Close
Set ofLog = Nothing
Set wmiprocess = Nothing
Set wmiprocesses = Nothing
=================


On Wed, 14 May 2003 19:18:44 -0400, "Frank Haber"
 wrote:

>Is there any way to do a keystroke-macro thing for IE6?  For an older user,
>I'd like to supply a hotkey or an icon to drill down through
>Tools|Options|accEssibilty|"Format Documents using my style
sheet," then
>supply a 12-13-pt style sheet.
>
>Then I'd like to toggle that off, of course.

--- BBBS/NT v4.01 Flag-4
* Origin: Barktopia BBS Site http://HarborWebs.com:8081 (1:379/1.45)
SEEN-BY: 633/267 270
@PATH: 379/1 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.