Jump to content

Controlsend : select file in the save as field in notebook


ctimer
 Share

Recommended Posts

I am trying to select a file by typing the file name 

I know the easier way is to use a single command to do it but i want to do it this way 

writing "question" into the body of the text file works fine but not into the "save as" box

 

#include <GuiMenu.au3>
#include <GuiComboBox.au3>
_Main()

Func _Main()
Run("notepad.exe")
WinWaitActive("[CLASS:Notepad]")
$hWnd = WinGetHandle("[CLASS:Notepad]")
$hMain = _GUICtrlMenu_GetMenu($hWnd)
$t1 = _GUICtrlMenu_GetItemText($hMain, 0)
$hFile = _GUICtrlMenu_GetItemSubMenu($hMain, 0)
$t2 = _GUICtrlMenu_GetItemText($hFile, 3)
Writeln("Question: ")

; here is the solution. It is language independent.

WinMenuSelectItem($hWnd, "", $t1, $t2)
sleep (2000)

ControlGetHandle("Save as", "", "Class:edit; instance1")
WinWaitActive("[CLASS:Notepad]")
sleep (2000)

ControlSend( $hWnd, "", "Edit1", "testing")
EndFunc ;==>_Main

 

 

 

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