Sign in to follow this  
Followers 0
tradertt

Create Exe File To Auto Click On A Save As Window

26 posts in this topic




Hi

Can anyone help me create a EXE file to auto click in the background a SAVE AS window that is opened by any program. Need not be excel. As long as it is SAVE AS, it will auto click it and it must work in the background.

Please help.

Open your save as and check it with C:\PROGRA~1\AUTOIT3\AU3INFO.EXE

then

ControlClick

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

Sends a mouse click command to a given control.

ControlClick ( "title", "text", controlID [, button] [, clicks]] )

Share this post


Link to post
Share on other sites

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Sorry about the stupid question. This is the very first time I am using AutoIT. Was using Perfect Keyboard previously.

How do I Check It?

ControlClick is?

How do I send a mouse click command?

If there is a way I can learn AutoIt please do direct me to it.

Download the help file

http://www.autoitscript.com/forum/index.php?showtopic=19717#

and go to :

mk:@MSITStore:C:\PROGRA~1\Autoit3\AutoIt3.chm::/html/functions/ControlCommand.htm

there are samles too :

ControlClick

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

Sends a mouse click command to a given control.

ControlClick ( "title", "text", controlID [, button] [, clicks]] )

Parameters

title The title of the window to access.

text The text of the window to access.

controlID The control to interact with. See Controls.

button [optional] The button to click, "left", "right" or "middle". Default is the left button.

clicks optional] The number of times to click the mouse. Default is 1.

Related

ControlCommand, ControlFocus, MouseClick

Example

ControlClick("Untitled -", "", "MDIClient1")

Share this post


Link to post
Share on other sites

Thank you.

By the way, I tried using SCITE to add in the code but am not too sure what to add in for the

ControlClick ( "title", "text", controlID [, button] [, clicks]] )

Buton and Clicks portion

Press CTRL-ALT-F to pause the display.

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<

Title: Save Web Page

Class: #32770

Size: X: 0 Y: 19 W: 561 H: 443

>>>>>>>>>>> Mouse Details <<<<<<<<<<<

Screen: X: 513 Y: 375

Cursor ID: 2

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<

RGB: Hex: 0xD4D0C8 Dec: 13947080

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<

Size: X: 474 Y: 328 W: 75 H: 23

Control ID: 1

ClassNameNN: Button2

Text: &Save

>>>>>>>>>>> Status Bar Text <<<<<<<<<<<

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<

Save &in:

My Documents

FolderView

File &name:

Create Exe File To Auto Click On A Save As Window - AutoIt Forums

Create Exe File To Auto Click On A Save As Window - AutoIt Forums

Save as &type:

Web Page, complete (*.htm;*.html)

&Save

Cancel

&Encoding:

Western European (ISO)

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<

Open as &read-only

&Help

This is what I got from the info.

Share this post


Link to post
Share on other sites

This is a generic sample made on a Notepad save as

(It's ITALIAN change CAPTIONS)

while 1

sleep(2500); Added sleep for give the time to watch

   AutoItSetOption("WinTitleMatchMode", 4)
    WinWaitActive( "Salva con nome", "", 5 )
 ControlFocus ( "Salva con nome","" , "Button2" )
 ControlClick ( "Salva con nome", "" , "Button2","left" )
wend

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Based off the informaion you provided, you'll use 2 things here: 1.. The title, 2.. The information on >>>> Control Under Mouse <<<<

ControlClick ( "Save Web Page", "&Save", "Button2")
In this case we can use the ClassNameNN instead of the Control ID (More specific in my opinion). Also notice when you are viewing something in help or about a command, anything in brackets "[button], [clicks]" are optional, and don't have to be used.

Edit:

Also, I meant to say this earlier... You should post support questions in the support forum :) ...

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Sorry just 2 questions for the moment that will be it.

1) if I need it to moniter in the background for any such windows that may pop up in the next 3 hours and do it repeately for the whole of 3 hours for any windows that pop up - Do I use sleep and how do I loop it?

2) What if the window is not the active window? will it be affected? I want ALL Save AS windows to be closed.

Share this post


Link to post
Share on other sites

Oops sorry about that. Thought I was supposed to post in the Scripts portion. Should I continue asking there? :) or can someone move this thread over?

Have you unterstand how it works ?

Open notepad and click on save as and check whit

C:\PROGRA~1\AUTOIT3\AU3INFO.EXE

Share this post


Link to post
Share on other sites

Sorry just 2 questions for the moment that will be it.

1) if I need it to moniter in the background for any such windows that may pop up in the next 3 hours and do it repeately for the whole of 3 hours for any windows that pop up - Do I use sleep and how do I loop it?

2) What if the window is not the active window? will it be affected? I want ALL Save AS windows to be closed.

Here om a windows98 ALL the save as are >>> ( classname=#32770 )

check the help file

You can use an infinite loop instead sleep

While 1

; code

Wend

Share this post


Link to post
Share on other sites

Here om a windows98 ALL the save as are >>> ( classname=#32770 )

while 1

sleep(1500)
   AutoItSetOption("WinTitleMatchMode", 4)
    WinWaitActive( "classname=#32770", "", 5 )
 ControlFocus ( "classname=#32770","" , "Button2" )
 ControlClick ( "classname=#32770", "" , "Button2","left" )
wend

Share this post


Link to post
Share on other sites

Do I have to have Programming language to work on AutoIt? I know nuts about programming VBA etc....

NO ... only Notepad and save the script as *.au3 .... open (launch) it with

C:\Programmi\Autoit3\AutoIt3.exe

Share this post


Link to post
Share on other sites

Wow, you guys are going out in left field I think... You don't have to use the classname= he has the title of the window he needs to work in right from the information he posted from the AutoInfo.exe tool. I gave an 'exact' example of how to use ControlClick() for that specific window, for that specific Control ID I believe.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Wow, you guys are going out in left field I think... You don't have to use the classname= he has the title of the window he needs to work in right from the information he posted from the AutoInfo.exe tool. I gave an 'exact' example of how to use ControlClick() for that specific window, for that specific Control ID I believe.

Yes CAUTION it clicks on every classname=#32770 based Windoes

I have made an quick script and forgot it

Share this post


Link to post
Share on other sites

Oh so I can use Notepad only :) thanks.

Looks like I have to learn about programming language.

do I read up on VBA or C++?

Neither, just read the helpfile. AutoIt is its own language.

Share this post


Link to post
Share on other sites

Hehe ... Thanks. I think it works for now. Will start reading the help file and learning more about the language.

By the way, if the file name exists, it will go into an error loop as it will keep asking if I want to overwrite it but it will keep saying NO so it will keep going into a loop. How do I overcome that?

Share this post


Link to post
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
Sign in to follow this  
Followers 0