As usual, some fixes for previous post...

miinx wrote about a Moz password dialog script:
> ;--- start ---
> if (arg(1)==3 && arg(3)=="XPCOM:EventWindow" &&         ;;+
> (exe== "firefox" || exe=="thunderbird" || exe=="thunde~1")) do
>     wait.for(10000, activewindow("Prompt"))
>     wait.for(500)
>     if (win.width("Prompt")==405 &&         ;;+
>     (win.height("Prompt")>140 || win.height("Prompt")<146))
>          win.sendkeys("{to ^Prompt}mypassword{en}")
>     endif
>     quit
> endif
> ;--- end ---
>   

I cut a couple of lines outta the script above before posting, thinking 
it aided clarity but have realised that anyone trying to use the script 
will run into problems sometimes, so..

Add the following 2 lines:
    if (not visiblewindow("Prompt")) do
        quit

after the line:
    wait.for(10000, activewindow("Prompt"))

which will exist the script in situations where a window with caption 
"Prompt" does not open within 10 seconds, to avoid errors on subsequent 
lines from a non-existent "Prompt" window.

Incidentally, there are possibly more elegant ways to do this, this is 
what I've hacked my way to, however.  :)

Also, it ain't terribly secure, so to that end you could extend on the 
above to use an encrypted password, or grab it from a db, or whatever is 
your fancy.


Something else I wrote without thinking:
> The window size info I determined purely by actually measuring the 
> dialog, plus a bit of trial & error as I hit snags.
>   
Beh, I lie!  Not sure where my head was, I didn't "actually measure the 
dialog", but I did use PowerPro's supa-nifty window info dialog, which 
most everyone here probably knows about, but in case you don't, check it 
out, as it enables you to grab window dimensions, classname, position, 
exe name & more really easily. 

It's enabled with the command Exec.WindowInfo (or select *Exec in 
command drop-down & WindowInfo in action drop-down of the command 
editor).  Set a hotkey [I use a double right mouse click on the upper 
right quadrant of a window... and phew! glad I've got a hotkey ;)] to 
call Exec.WindowInfo so you can quickly get whatever info you need.

Ummm...  think that's it!

Karen



Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to