Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

ControlSetText on toolbarWindow

$
0
0

Hello!

 

I have a little script and in it a function that is responsible for handling saves in PDFCreator. When such a situation arise, it should set the destination folder to one predestinated in a global variable (a folder in our innernetwork).

 

Originally I achieved this by moving the window to 0,0 then mouseclick on a specified coordinates on the screen (I know, I know, thats why I want to change it something more reliable, more intelligent)

 

My candidates were ControlSetText, ControlSend and ControlCommand. I rejected ControlCommand outright since it isn't really for this. ControlSend cause the script to exit, when it reaches the first point where it would use the function.

 

ControlSetText returns the next console (run_debug_mode=Y)

 

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "D:\régi gép mentés\Desktop\Automata Tesztelés\UD - uszi új BÉTA\ud_uszi 3.0.1 teszter.au3"    
"D:\régi gép mentés\Desktop\Automata Tesztelés\UD - uszi új BÉTA\ud_uszi 3.0.1 teszter.au3" (1170) : ==> Error in expression.:
ControlSetText("Save as", "", "[CLASSNN:ToolbarWindow323]", & $PDFmentesPath)
ControlSetText("Save as", "", "[CLASSNN:ToolbarWindow323]", ^ ERROR
>Exit code: 1    Time: 34.31
 

 

Here is my function so far: (sorry its under construction)

AutoIt         
Func RenamePDF($TopUpName)     Sleep(1000)     WinActivate("PDFCreator 1.", "")     WinWaitActive("PDFCreator 1.", "")     ControlCommand("PDFCreator 1.", "", "[CLASSNN:ThunderRT6TextBox6]", "EditPaste", $TopUpName)     ControlSetText("PDFCreator 1.", "", "[CLASSNN:ThunderRT6TextBox6]", $TopUpName)     ControlClick("PDFCreator 1.", "", "[CLASSNN:ThunderRT6CommandButton7]")     $WindowWaitCheck = WinWaitActive("Mentés másként", "", 5)     If $WindowWaitCheck = 0 Then         ControlClick("PDFCreator 1.", "", "[CLASSNN:ThunderRT6CommandButton7]")     EndIf     WinMove("Save as", "", 0, 0)     ;MouseClick("", 565, 50) ;Not like this, to many possible errors!     ;Send("{BS}" & $PDFmentesPath & "{Enter}")     ;ControlCommand     ;ControlSend("Save as", "", "[CLASSNN:ToolbarWindow323]", & $PDFmentesPath)     ControlSetText("Save as", "", "[CLASSNN:ToolbarWindow323]", & $PDFmentesPath)     ControlClick("Save as", "", "[CLASSNN:Button1]")     Sleep(1500) EndFunc   ;==>RenamePDF

I have a guess that there is a problem in how I try to write/send the variable $PDFmentesPath, but not sure I know how should I do it. Trying random things that come to mind for now.

 

Thank you for your time and help!


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>