Jump to content

Unable to click the save button


 Share

Recommended Posts

I'm just trying to click the save button in the File Download window (IE) using the code below.

I tried almost everything except controlCommand() (Don't know how to use it), I need some help here please.

This is a link to a direct download from www.download.com\...

Here is the Code:

Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)

Opt( "WinSearchChildren" , 1 )

WinWait( "File Download" , "Do you want to " )
saveFileTo()

Func saveFileTo();{
    $L_hwnd = WinGetHandle ( "File Download" , "Do you want to " )

    ConsoleWrite('--> $L_hwnd = ' & $L_hwnd & @lf & '>Error code: ' & @error & @lf) ;### Debug Console

    ConsoleWrite('--> ControlFocus ( $L_hwnd , "" , "Button2" ) = ' & ControlFocus ( $L_hwnd , "" , "Button2" ) & @lf & '>Error code: ' & @error & @lf) ;### Debug Console

    ConsoleWrite('--> ControlClick ( $L_hwnd , "" , "Button2" ) = ' & ControlClick ( $L_hwnd , "" , "Button2" ) & @lf & '>Error code: ' & @error & @lf) ;### Debug Console
    
EndFunc;}

Thanks in advance.

RK

Edited by rbhkamal

"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

Link to comment
Share on other sites

I'm also having a porblem with contorlGetPos().

Opt( "WinSearchChildren" , 1 )

WinWait( "File Download" , "Do you want to " )

WinActivate( "File Download" , "Do you want to " )

Sleep( 100 )

$pos = ControlGetPos(  "File Download" , "Do you want to ",  "Button2" )
MouseMove( $pos[0] , $pos[1] )

RK

"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

Link to comment
Share on other sites

It worked!!!!

Edit: I just installed the new Beta .12 and added the lines:

WinWait( "File Download" , "Do you want to " )
WinActivate("File Download" , "Do you want to " )
WinWaitActive("File Download" , "Do you want to " )
Sleep( 1000 )

Thank you for reading... really!

RK

Edited by rbhkamal

"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

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