Jump to content

Recording mouse clicks and screen res.


 Share

Recommended Posts

Howdy folks... long time WISE user, new to Autoit but i like what I see so far! I am trying to script an install for an IE certificate and a few of the buttons dont' have ALT + key operations so i've reverted to mouse clicks.

I have captured the clicks and the playback works fine on several machines with similar resolution, but I've noticed that a jump from 1024x768 to 1600x1200 for example seems to break the script.

Are there any tricks here that would save me from having to write a different script for each res and then check before running?

thanks!!

ps... if I can program keystrokes to replace the mouse clicks, i'd be all over that too :whistle:

Link to comment
Share on other sites

Howdy folks... long time WISE user, new to Autoit but i like what I see so far!  I am trying to script an install for an IE certificate and a few of the buttons dont' have ALT + key operations so i've reverted to mouse clicks.

I have captured the clicks and the playback works fine on several machines with similar resolution, but I've noticed that a jump from 1024x768 to 1600x1200 for example seems to break the script.

Are there any tricks here that would save me from having to write a different script for each res and then check before running?

thanks!!

ps... if I can program keystrokes to replace the mouse clicks, i'd be all over that too :whistle:

<{POST_SNAPBACK}>

check out ControlSend() and ControlClick() in the help file, that should take care of it...
Link to comment
Share on other sites

check out ControlSend() and ControlClick() in the help file, that should take care of it...

<{POST_SNAPBACK}>

Hey, thanks.

So instead of this...

WinWait("Certificate","&Install Certificate")

If Not WinActive("Certificate","&Install Certificate") Then WinActivate("Certificate","&Install Certificate")

WinWaitActive("Certificate","&Install Certificate")

MouseMove(224,422)

MouseDown("left")

MouseUp("left")

Sleep(1000)

I could have something like...

ControlClick ( "Certificate", "&Install Certificate", 108 [, left] [, 1]] )

???

Link to comment
Share on other sites

Hey, thanks.

So instead of this...

WinWait("Certificate","&Install Certificate")

If Not WinActive("Certificate","&Install Certificate") Then WinActivate("Certificate","&Install Certificate")

WinWaitActive("Certificate","&Install Certificate")

MouseMove(224,422)

MouseDown("left")

MouseUp("left")

Sleep(1000)

I could have something like...

ControlClick ( "Certificate", "&Install Certificate", 108 [, left] [, 1]] )

???

<{POST_SNAPBACK}>

yes but take out the ]['s those are to designate optional parameters, you don't have to have them around your arguments in the actual call
Link to comment
Share on other sites

yes but take out the ]['s those are to designate optional parameters, you don't have to have them around your arguments in the actual call

<{POST_SNAPBACK}>

It seemed to require a bit extra to work... but i got it.

WinWait("Security Warning","You are about to ins")

If Not WinActive("Security Warning","You are about to ins") Then WinActivate("Security Warning","You are about to ins")

WinWaitActive("Security Warning","You are about to ins")

ControlClick ( "Security Warning", "You are about to ins", 6 )

MouseClick("left")

Now to test more resolutions.

Thanks for the help!!!

Link to comment
Share on other sites

Guest tygran

If this does not work and the window has in each resolution the same size(pixel), you can use the option "MouseCoordMode". Then the coordinates are relative to the active window.

e.g.:

Opt("MouseCoordMode", 0) ;; Mouse coordinates relative to active window

MouseClick($primary, 191, 185, 1, 1)

java script:emoticon(':whistle:')

smilie

Link to comment
Share on other sites

So now I have a working script... works on 800x600 as well as 1600x1200.

Some of the buttons don't have control numbers, so i've had to leave in the mouse captures for those parts.

Is there another way to click those buttons where the control is hidden?

Thanks a bunch!

Link to comment
Share on other sites

Hopefully 1 last question :whistle:

I'm trying to figure out logic for IF statements pertaining to active windows. One of the factors that changes in my script depends on whether the certificate has been installed or not already. If it has, there is one less dialogue that pops up.

So it would be very helpful if I could use...

If Not WinActive("Security Warning","You are about to ins") Then WinActivate("Security Warning","You are about to ins")

A bit differently to launch a different key combination depending on whether that dialogue box appears or a different one does.

Any ideas?

Thanks!

Link to comment
Share on other sites

Hopefully 1 last question :whistle:

I'm trying to figure out logic for IF statements pertaining to active windows.  One of the factors that changes in my script depends on whether the certificate has been installed or not already.  If it has, there is one less dialogue that pops up.

So it would be very helpful if I could use...

If Not WinActive("Security Warning","You are about to ins") Then WinActivate("Security Warning","You are about to ins")

A bit differently to launch a different key combination depending on whether that dialogue box appears or a different one does.

Any ideas?

Thanks!

<{POST_SNAPBACK}>

you could do a little loop to check which window pops up and react accordingly.

here's a sample

while 1
    if WinExists("Window1") then
        ...;your code here for one window
        ExitLoop
    EndIf
    if WinExists("Window2") then
        ...;your code here for next
            ExitLoop
        EndIf
WEnd
Link to comment
Share on other sites

Hopefully 1 last question :whistle:

I'm trying to figure out logic for IF statements pertaining to active windows.  One of the factors that changes in my script depends on whether the certificate has been installed or not already.  If it has, there is one less dialogue that pops up.

So it would be very helpful if I could use...

If Not WinActive("Security Warning","You are about to ins") Then WinActivate("Security Warning","You are about to ins")

A bit differently to launch a different key combination depending on whether that dialogue box appears or a different one does.

Any ideas?

Thanks!

<{POST_SNAPBACK}>

Nevermind, I figured out the if logic :dance:

If WinActive("Security Warning","You are about to ins") Then

WinWait("Security Warning","You are about to ins")

If Not WinActive("Security Warning","You are about to ins") Then WinActivate("Security Warning","You are about to ins")

WinWaitActive("Security Warning","You are about to ins")

ControlClick ( "Security Warning", "You are about to ins", 6 )

MouseClick("left")

Sleep(1000)

ElseIf WinActive("Certificate Import Wizard","The import was succe") Then

WinWait("Certificate Import Wizard","The import was succe")

If Not WinActive("Certificate Import Wizard","The import was succe") Then WinActivate("Certificate Import Wizard","The import was succe")

WinWaitActive("Certificate Import Wizard","The import was succe")

ControlClick ( "Certificate Import Wizard", "The import was succe", 2 )

MouseClick("left")

Sleep(1000)

EndIf

That worked great...

If someone could help eliminate my mouse capture that would be amazing!

Thanks for everyone's help!

Link to comment
Share on other sites

you could do a little loop to check which window pops up and react accordingly.

here's a sample

while 1
    if WinExists("Window1") then
        ...;your code here for one window
        ExitLoop
    EndIf
    if WinExists("Window2") then
        ...;your code here for next
            ExitLoop
        EndIf
WEnd

<{POST_SNAPBACK}>

Wow, thanks...that's cleaner than mine :whistle:
Link to comment
Share on other sites

Wow, thanks...that's cleaner than mine :whistle:

<{POST_SNAPBACK}>

glad i could help... for your mouse issue, did you see the post by Tygran? that may help, if not, there are alot of posts on the forum about identifying and manipulating controls (and overcoming issues doing so)
Link to comment
Share on other sites

  • 3 years later...

http://home.fnal.gov/~jklemenc/importpfx.html provides a tool that will automatically do the import into the personal or root store on a system. This works great for Internet Explorer.

However, I'm trying to now do the equivelant for Firefox. I've found http://www.mozilla.org/projects/security/pki/nss/tools/ but they do not look simple to use at all. Any suggestions?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...