Jump to content

A Simple Question...


Recommended Posts

Hi Friends...

I Have A Simple Problem, But You Know I Can't Find The Reason Why Its Not Working... :dunno:

Say, I Have This Page Open In A Window, In 1024x768 Mode In 17'' Monitor... http://www.mozilla.com/en-US/firefox/all.html

I Click On The 1st Download Button & I Want To Save The Firefox SetUp File... So What I Did Is..

Opt("WinTitleMatchMode", 2)

if WinExists("Mozilla") Then

WinActivate("Mozilla")

MouseClick("left", 460, 402) # Position Depends...

WinWaitActive("File Download")

Sleep(100)

ControlClick("File Download", "&Save", "Button2")

EndIf

But The SAVE AS Window Is Not Opening.... I Don't Know Why....

Pls Help & Thanks In Advance.... :rolleyes:

Edit: Its Focusing On The Save Button, But Doing Nothing....

I Also Tried....

ControlClick("File Download", "&Save", 4427)

But.. :rambo:

Edited by sandeb
Link to comment
Share on other sites

Welcome to the forum.

Here is a version of your script that worked for me.

I had to change a window title to fit my version of Ff.

I also had to adjust the mouse coordinates a bit...

...see my comments below the code.

Opt("WinTitleMatchMode", 2)

If WinExists("Mozilla") Th[Ú[]]J    ][ÝÓ[Þ[I][ÝÊB[ÝÙPÛXÚÊ ][ÝÛY ][ÝË

ÂC#"¢våvD7FfRgV÷C´÷Væærf&Vf÷6WGWgV÷C²¢6VæBgV÷C·9QIôÅÕ½Ðì¤)¹%oÝ÷ ÙvØ^éi~)^¢s©·ó(ºÇ¢Ý2^.$jÛax­ VwhÀߢÚ(éÝz³©¶*'²B¢Ý2^1©²êÞ¶­¶±ÉÊ(­Ø§j׬¶­Ê z×ë¢kajÛh¢V ­ç¬Â+a¶¦Û¶Ø§È§Ê«±Êâ¦Ôáz·­æ޶׫Á¬¬¶¶ØZµø¥y«­¢+Ù%¹ÑÐ ÅÕ½ÐíÑÀè¼½ÑÀµµ½é¥±±¹¹ÑÍÁ¹½´½ÁÕ½µ½é¥±±¹½É½¥É½à½É±Ís/2.0.0.4/win32/en-US/Firefox%20Setup%202.0.0.4.exe","Firefox Seu^I][ÝËJ
In case that code was just an example and you don't really want Ff file. Then you might want to read up on IE.au3. Just type in "ie" into the help file's index tab.

hope this helps

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Thanks herewasplato... Yes It Works With MouseClick, But Can You Please Explain Why Its Not Working With " ControlClick".... Or Send('!s'), Because If I Press Alt+s From Keyboard It Opens The Save As window.....But "Send" Is Not Working... :rolleyes:

Link to comment
Share on other sites

Thanks herewasplato...

You are welcome.

...Yes It Works With MouseClick, But Can You Please Explain Why Its Not Working With " ControlClick"....

From the help file under "Controls":

Note: AutoIt only works with standard Microsoft controls - some applications write their own custom controls which may look like a standard MS control but may resist automation. Experiment!

...Or Send('!s')..

I'm not sure - I'll test that when I get the time. I don't have Ff on this system.

...But "Send" Is Not Working... :rolleyes:

Are you saying that the Send("{ENTER}") in the code that I posted is not working for you? It worked for me.

The small bit of code that I posted was mainly to talk about the various issues with getting and using mouse coordinates. I would not recommend this method to deploy or upgrade Ff on other's systems. You might do better with the InetGet/FTP method that I also posted, but that would mean changing your script with each update of Ff unless you can find a file somewhere that always points to the latest FTP path.

-MSP-

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Note: AutoIt only works with standard Microsoft controls - some applications write their own custom controls which may look like a standard MS control but may resist automation. Experiment!

May Be Thats The Reason... :dunno:

And Yes For Me...

Send("{ENTER}") And Send('!s') Both Are Not Working.... :rolleyes:

But

Opt("WinTitleMatchMode", 2)

Opt("MouseCoordMode", 0)

if WinExists("Mozilla") Then

WinActivate("Mozilla")

MouseClick("left", 468, 411)

WinWaitActive("File Download")

WinMove("File Download", "", 0, 0)

MouseClick("left",255,154)

Is Working For Me... But As I Said I Can't Rely On MouseClick As Its Not Full Proof, Depends On Various Facts As Resolution etc....

Is Not The Download Window In IE Is A Standard MCFT Control? Because I Noticed That When I Use Send('!s') The Small Underline Below The "S" In Save Button Is Coming Out But Then Nothing Happens, i.e. The Save Button Is On Focus But Its Not Getting Clicked...

Link to comment
Share on other sites

I'm not sure why the controlclicks don't work...

but I did not spend much time on it.

try:

Opt("WinTitleMatchMode", 2)

If WinExists("Mozilla") Th[Ú[]]J    ][ÝÓ[Þ[I][ÝÊB[ÝÙPÛXÚÊ ][ÝÛY ][ÝË

ÂC#"¢våvD7FfRgV÷C´F÷væÆöBgV÷C²¢6VæBgV÷C·´ÄTeGÒgV÷C²M±À äää¤(M¹ ÅÕ½Ðíí9QIôÅÕ½Ðì¤)¹%

To get rid of the first MouseClick you will need to dive into the _IE UDFs or use the tab method mentioned here: http://www.autoitscript.com/forum/index.php?showtopic=14395

-MSP-

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

I have had the same problem, but my issue is that I can't use the plain "send" commands because I'm running the script with the screen locked. I've tried all sorts of variations of controlclick and controlsend. None seem to work. I'm thinking about changing the folder options on the file type (.csv) to not prompt me for download and automatically open in Excel. I'll probably get stuck again when I try to save the file :rolleyes:

Link to comment
Share on other sites

I have had the same problem, but my issue is that I can't use the plain "send" commands because I'm running the script with the screen locked. I've tried all sorts of variations of controlclick and controlsend. None seem to work. I'm thinking about changing the folder options on the file type (.csv) to not prompt me for download and automatically open in Excel. I'll probably get stuck again when I try to save the file :rolleyes:

Welcome to the forum Lon. The problem is similar but the solution might be to use INetGet to get your XLS file and then use COM to manipulate the data within the file - all without opening a window.

You might want to open a new topic and see if someone can help you learn COM.

[size="1"][font="Arial"].[u].[/u][/font][/size]

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