Jump to content

Click Button with Mouse


Recommended Posts

Hi,

I'm coming from Winbatch scripting and I'm looking for a command to click on a specific button, say "Next >" for example. Is this possible?

Jo

Hi,

Yeap its possible, see in help file for ControlCommand

Check the help file a.k.a. The Bible!!! :)

Cheers

Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Link to comment
Share on other sites

OK, that works. I did check the 'bible', but I got lost somewhere in the neighbourhood of Genesis...

Now I can press buttons. What about checking check boxes? Especially check boxes that are contained inside another control. This is what Winbatch's control manager shows me:

Control Manager version 20025

P C C C C

A H H H H

R I I I I

E L L L L

N D D D D

T 2 3 4 5 CLASS IDENT TITLE

--------------------------------------------------------------------------------

TOP #32770 0 CCleaner v1.40 Setup

1 Button 3 < &Back

X NONE

2 Button 1 &Install

X NONE

3 Button 2 Cancel

X NONE

4 Static 1018

X NONE

5 Static 1044

X NONE

6 Static 1035

X NONE

7 Static 1036

X NONE

8 Static 1045

X NONE

9 Static 1256 www.ccleaner.com

X NONE

10 Static 1028 www.ccleaner.com

X NONE

11 Static 1034

X NONE

12 Static 1037 Install Options

X NONE

13 Static 1038 Select any additional options

X NONE

14 Static 1046

X NONE

15 #32770 0

1 Button 1200 Add Desktop Shortcut

X NONE

2 Button 1201 Add Start Menu Shortcuts

X NONE

3 Button 1202 Add 'Run CCleaner' option to Recycle Bin context menu

X NONE

4 Button 1203 Add 'Open CCleaner...' option to Recycle Bin context menu

X NONE

5 Button 1204 Automatically check for updates to CCleaner

X NONE

6 Static 1205 (This may not work if you have a firewall installed)

X NONE

7 Button 1206 Add CCleaner Yahoo! Toolbar and use CCleaner from your browser

X NONE

This is my code:

$title="CCleaner"

WinWait($title)

ControlCommand (title, "", 1200, "UnCheck", "")

ControlCommand (title, "Add Desktop Shortcut", 1200, "UnCheck")

ControlCommand (title, "Add Start Menu Shortcuts", 1201, "UnCheck")

ControlCommand (title, "Add 'Run CCleaner' option to Recycle Bin context menu", 1202, "UnCheck")

ControlCommand (title, "Add 'Open CCleaner...' option to Recycle Bin context menu", 1203, "UnCheck")

ControlCommand (title, "Automatically check for updates to CCleaner", 1204, "UnCheck")

ControlCommand (title, "Add CCleaner Yahoo! Toolbar and use CCleaner from your browser", 1206, "UnCheck")

As I coded it with the Window Info tool, of which I copy the summary:

The question is: is it possible to 'descend into the #32770 'container'?

>>>> Window <<<<

Title: CCleaner v1.40 Setup

Class: #32770

Position: 388, 305

Size: 503, 386

Style: 0x94CA084C

ExStyle: 0x00010100

>>>> Control <<<<

Class: #32770

Instance: 1

ID:

Text:

Position: 414, 400

Size: 450, 228

ControlClick Coords: 158, 47

Style: 0x50000444

ExStyle: 0x00010000

>>>> Mouse <<<<

Position: 572, 447

Cursor ID: 2

Color: 0xD4D0C8

>>>> StatusBar <<<<

>>>> Visible Text <<<<

< &Back

&Install

Cancel

www.ccleaner.com

www.ccleaner.com

Install Options

Select any additional options

Add Desktop Shortcut

Add Start Menu Shortcuts

Add 'Run CCleaner' option to Recycle Bin context menu

Add 'Open CCleaner...' option to Recycle Bin context menu

Automatically check for updates to CCleaner

(This may not work if you have a firewall installed)

Add CCleaner Yahoo! Toolbar and use CCleaner from your browser

>>>> Hidden Text <<<<

Link to comment
Share on other sites

A bit lower, after the Genesis... :)

ControlGetText

:)

ControlClick

and so on :)

:P

Cheers

Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Link to comment
Share on other sites

Or make it use

Send("^n")
oÝ÷ Ù8Z¶Þ²Ç¬[méçþ«¨µâ-)äʦy©ÚºÚ"µÍÙ[
    ][ÝÉÌÌÎÛ][ÝÊ

:)

Dave

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------"I don't need to know everything, I just need to know where to find it when I need it"....EinsteinAnd in our case... That's the AutoIT helpfile ;) Please read before posting!!!

Link to comment
Share on other sites

>

>A bit lower, after the Genesis... :)

Oh, you mean I have to go all the way to the New Testament, where the advanced tricks are explained. :-)

>ControlGetText

>:)

>ControlClick

>and so on :)

These controsl are embedded into another control. There are no keyboard shortcuts for the options. I like the clean way of being able to address the controls by their IDs. I could of course get by by controlling the mouse pointer, but that gets messy, if you ask me.

Is there a way to reach those. Please see my previous message to see what I'm talking about.

Jo

Link to comment
Share on other sites

Hi again m8

Download Scite,

You'll have in tools an option called AU3info!

Quite handy!

Cheers :)

Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Link to comment
Share on other sites

I do recommend Scite, but to make it clear Au3Info comes with AutoIt, not Scite.

:) Ouch :)

Indeed... BAD NOVEMBER!!!

:)

Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Link to comment
Share on other sites

I fixed it with a workaround. Here is the entire script. For some reason I'm not allowed to post in Example Scripts.

; This script requires full Administrative rights

#requireadmin

$workdir="C:\Download"

$inifile = "C:\autoFix.it\files2download.ini"

$var = IniReadSectionNames($inifile)

If @error Then

MsgBox(4096, "Error occurred, probably no INI file.", "Make sure you copy the autoFix.it folder to C:\")

Else

$value = IniRead($inifile, "CCleaner", "Setup", "NotFound")

If $value <> "NotFound" Then

Run($workdir & "\" & $value)

$title="Installer Language"

WinWait($title)

ControlClick($title, "OK", 1)

$title="CCleaner"

WinWait($title)

ControlClick($title, "Next >", 1)

$title="CCleaner"

WinWait($title)

ControlClick($title, "I &Agree", 1)

$title="CCleaner"

WinWait($title)

ControlClick($title, "Next >", 1)

$title="CCleaner"

;MsgBox(0, "Waiting for", $title)

WinWait($title)

;MsgBox(0, "Appeared", $title)

;ControlCommand (title, "Add Desktop Shortcut", 1200, "UnCheck")

;ControlCommand (title, "Add Start Menu Shortcuts", 1201, "Check")

;ControlCommand (title, "Add 'Run CCleaner' option to Recycle Bin context menu", 1202, "UnCheck")

;ControlCommand (title, "Add 'Open CCleaner...' option to Recycle Bin context menu", 1203, "UnCheck")

;ControlCommand (title, "Automatically check for updates to CCleaner", 1204, "Check")

;ControlCommand (title, "Add CCleaner Yahoo! Toolbar and use CCleaner from your browser", 1206, "UnCheck")

WinActivate($title)

Send("{SPACE}{TAB}{TAB}{SPACE}{TAB}{SPACE}{TAB}{TAB}{SPACE}")

Sleep(4000)

ControlClick($title, "Install", 1)

$title="CCleaner"

WinWait($title)

ControlClick($title, "Finish", 1)

EndIf

EndIf

Link to comment
Share on other sites

I'm happy that worked!

Cheers m8 and have a nice script day :)

Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

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...