Re: wscript.echo and MsgBox stop execution of my script. Solution?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Michael Bouchard (mbouchard_at_xNOSPAMx.ci.charlotte.nc.us)
Date: 08/11/04


Date: Wed, 11 Aug 2004 09:05:26 -0400

You can use AutoIT for this (www.hiddensoft.com). I have created an AutoIT
script which I then compiled into an exe. I can then call this exe from a
script or command line with the parameters specified. When I want to close
the message box, I just need to call the exe with no parameters.

**Start Sample VBscript Watch for line wraps
Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")
Dim WshShell : Set WshShell = CreateObject("WScript.Shell")
sTEST = "300 150 50 50 16 -1 -1"'position of window. Look at Documentation
for specifics
'Note adding a ^ will cause a LF(1 LF per^).
'SplashTextOn($title, $message, $wide, $high, $xpos, $ypos, $opt,
"",$fsize,$fweight)
WshShell.Run "SplashText.exe ""This is the Title"" ""Testing SplashText"" "
& sTEST
wscript.sleep 3000
WshShell.Run "SplashText.exe ""This is the Title"" ""The Text will wrap if
it is too long for the window."" " & sTEST
wscript.sleep 3000
WshShell.Run "SplashText.exe ""This is the Title"" ""Adding 1 of these (The
Char above the number 6) will enter a LF^See^What^I^Mean."" " & sTEST
wscript.sleep 3000
WshShell.Run "splashtext.exe" 'Run it again to close it

**Start AutoIT script
;splash.au3 precomplie
AutoItSetOption("TrayIconHide", 1);1 = Hide Icon
winclose("Splashtext1");close other progress bar and show this one
AutoItWinSetTitle ("Splashtext1")

If $CmdLine[0]>0 Then
$title= $CmdLine[1]
$message= $CmdLine[2]
$wide = $CmdLine[3]
$high = $CmdLine[4]
$xpos = $CmdLine[5]
$ypos = $CmdLine[6]
$opt = $CmdLine[7]
$fsize = $CmdLine[8]
$fweight = $CmdLine[9]

$message2 = StringReplace($message, "^", @LF)

SplashTextOn($title, $message2, $wide, $high, $xpos, $ypos, $opt, "",
$fsize, $fweight)
While 1
Sleep(5000)
wend
EndIf

"Brendan O" <wildirishtiming@hotmail.com> wrote in message
news:4cbdb58c.0408100922.5ce25440@posting.google.com...
> I don't want a front end, I don't want any windows open, I don't want
> a gui. I need a function that I can call like msgbox that will open a
> popup window
> for notifications only, yet continue to run my code even if a user
> isn't
> sitting at the desk to press the OK button.
>
> Unless I'm mistaken completely, MsgBox and wscript.echo both halt
> script operations waiting for the user to press ok.
>
> Thanks for your help!
>
> -Brendan



Relevant Pages

  • Re: Newbie Question HELP!
    ... >print because this only seems to run in python shell, or is there a way to ... Others have mentioned ways to get an EXE, but I am wondering if you are really ... go back to the "DOS"/console window (or start one and cd to the ... and you'll be able to re-run your script by just typing python myprog.py (or even just myprog.py ...
    (comp.lang.python)
  • RE: java.awt.Robot equivalent?
    ... You don't really need to use ctypes to drive AutoIt - it's COM scriptable. ... window gained focus, the script would die. ... tests, some introductory docs, and an installation script. ...
    (comp.lang.python)
  • Re: OT: displaying docs on screen
    ... I would do it with an 'Autoit' script. ... If you can merge the PDFs in to one, the script could be much simpler. ... asks for the number of pages, and the delay you want between pages (so ... Also you need to watch out for the name of the Adobe window to activate. ...
    (uk.rec.motorcycles)
  • Re: How to prevent users from closing IE status window
    ... you are uncomfortable calling api's from script, then AutoItX has a BlockInput method. ... write it yourself using vb, or AutoIt (the scripting language -- which allows you to create windows, which they call GUI's), or any other "real" language for that matter. ... For example, in vb you can detect the "QueryUnload" event when the user attempts to close your form (window), and stop the user from closing it. ...
    (microsoft.public.scripting.vbscript)
  • Re: Compile .vbs files to .exe executables
    ... Script Editor" (the Script Packager feature will wrap your ... script into an Exe). ... The autoit and vbs scripting languages are very similar, ... files to stand-alone executables. ...
    (microsoft.public.scripting.vbscript)