Jump to content
AnakondaSK

Little help with my job script

Recommended Posts

AnakondaSK

Hello guys,

I am quiet new here and most important only beginner in scripting.

One part of my work in my job is inserting pretty much the same information into Web Application of my company.

So I made simply mousle click script and it kinda worked. Few colleagues saw it and they want this script too,  so I decided to improve it and make it more suitable and better for other computers.

Mostly i removed mouse click and things that can make some errors for other users.

I made it slowly but quiet good, but i have one problem on the end of process. In Web app i have 3 bookmarks (Page 1,2,3 -The green ones). Every bookmark has own yellow fields where i am inserting required data. I find out that i can move through yellow fields just by Tab key, but my problem is I am unable to move/switch without mouse click to other green bookmarks and to get acces to "page2" yellow fields. 

This web app is running on Mozilla Firefox, so my attempt to get information from Autoit window info failed (I got only information about the page)

So i would like to ask you guys, is there any way to do ControlClick just by knowing the name of the bookmark ?(because all my attempts and searching for answers failed)

Or any way how to press that green bookmark without using Mouse Click and only knowing the name of Bookmark

I would be thankful for any help or advice.

Have a nice day and thanks for any help! :)

Here is Example i made how it looks like (I have restriction of putting screens of real app)

Example1.thumb.jpg.2ebd093f4d206801dee4c

Ps. not sure if it helps but this web app has searh tool and after typing "page2" it will highlight the bookmark. (Then it is possible copy the name, but nothing like enter ot etc is not working even if the bookmark is highlight.

 

 

 

 

 

 

Share this post


Link to post
Share on other sites
232showtime

wheres your code???


ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Share this post


Link to post
Share on other sites
jvds

if it is web based and you can open it with Internet explorer then you will need to eat up the IE related functions examples in the help file,that is probably the best way to go, its not going to be easy if you are new, so prepare to spend a lot of time on it if you want to get anywhere, but once you get it to work its fun!

Share this post


Link to post
Share on other sites
AnakondaSK

wheres your code???

Sorry, here it is. Its only part of whole code. This part is for Autofill information to this WebApp. Dont know why but i cant post it here through the  "add code" function so this is only way it works for me. Hope its fine.

HotKeySet("{ESC}", "Terminate")
Opt("WinTitleMatchMode", 2)
Opt("MouseCoordMode",0)

Global $Data1
Global $Data2

$Data1="Text that is different" ;first variability
$Data2="Text that is different"  ;second variability

CREW()

Func CREW()
WinActivate("Process Workspace for Process") ;this open my active Mozilla with app
Send("Process Type") ;this highlight text before my first empty field, from this point i navigate through fisrt bookmark press Tab key
Send("{Enter}")
Send("{TAB}")
Send("{down 2}")
Send("{Enter}")
Sleep(1500)
Send("{TAB}")
Send("Same text I insert everytime") ;Same text every time I fillin this app
Sleep(200)
Send("{Enter}")
Send("{TAB}")
Send("Same text I insert everytime") ;Same text every time I fillin this app
Sleep(200)
Send("{TAB 5}")
Send("{Delete}")
Send("Same text I insert everytime") ;Same text every time I fillin this app
Sleep(500)
Send("{Enter}")
Send("{TAB 2}")
;here insert date from Lotus Notes (working on it in another script)
Send("{TAB}")
Send("{Delete}")
Send("Same text I insert everytime")
Sleep(500)
Send("{Enter}")
Send("{TAB}")
;here insert date from Lotus Notes (working on it in another script)
Send("{TAB}")
Send($Data1) ;Only this text change in inserting info to app
Send("{TAB 4}")
Send($Data2) ;Only this text change in inserting info to app
Send("{TAB}")
Send("{alt}")
Send("Document Type") ;Same text every time I fillin this app
Send("{TAB}")
Send("{down 2}")
Send("{Enter}")
;------------------->>>>>>>>>>>>>>>>>>>>>>>>>>>> Here I need some way to move to second bookmark to continue in process.
EndFunc


Func Terminate()
Exit 0
EndFunc

  

if it is web based and you can open it with Internet explorer then you will need to eat up the IE related functions examples in the help file,that is probably the best way to go, its not going to be easy if you are new, so prepare to spend a lot of time on it if you want to get anywhere, but once you get it to work its fun!

(Problem is I can open it only with Mozilla Firefox :/)

My bad I find out that is possible to run it with Internet explorer too

 

Code.au3

Edited by AnakondaSK

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

  • Similar Content

    • Pike
      By Pike
      Hello Everyone,
      New Guy here. This is a two-part question, hopefully easy enough though. I know it's ugly coding, this is because I have only a couple hours worth of coding experience and could really use some help.
      1) When I single click the button I want one action (like playing a sound clip) and when I double click the button I want a different action (such as opening dialogue box to ask for soundclip directory address). At the bottom of the script I made a comment which one I would like single click versus double click.
      2) I can not get the FileOpenDialogue to save the file address to the config.ini file at the 'One' position on the .ini.
      #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <FileConstants.au3> #include <AutoItConstants.au3> #include <Sound.au3> Opt('MustDeclareVars', 1) Opt("GUIOnEventMode", 1) Global $OneID _Main() Func _Main() GUICreate("Form1", 156, 86, 281, 276) $OneID = GUICtrlCreateButton("Button", 15, 17, 122, 37) GUICtrlSetOnEvent($OneID, "OnOne") GUISetOnEvent($GUI_EVENT_CLOSE, "OnExit") GUISetState() While 1 While 1 Sleep(1000) WEnd WEnd EndFunc ;---------------Functions------------- While 1 Sleep(100) WEnd Func OnOne() ; ******************Single Click for this action**************** $OneID = IniRead("config.ini", "Config", "One", $OneID) If $OneID = True Then SoundPlay($OneID, @HotKeyPressed) Else ; *******Double Click for this action*****And Help Saving File Address to config.ini 'One'*********** $OneID = FileOpenDialog("Select file", @WorkingDir, "All (*.*)") IniWrite("config.ini", "Config", "One", $OneID) $OneID = InputBox("Enter Information", "Short Name for File?", "") IniWrite("config.ini", "Config", "NameOne", $OneID) EndIf EndFunc Any help would be greatly appreciated, and if you need anymore clarity as to what exactly I'm trying to do, please do not hesitate to ask. Thanks so much!
      Pike
    • MaximusCZ
      By MaximusCZ
      Hello, and apologies if this have been discussed before, but I googled and couldnt find anything relevant.
      I have a problem where I try to send a control clink into to a window. 
      Part of window I try to send clicks to looks like this . The black border is showing when I mouse over it Au3Info, I get following information:

      I am testing its interaction with code

      The result I get is that it makes control clicks trough first line, opens and closes menus, as expected.
      When It gets to second line, it does not click a single icon. I can tell that coords are correct as the dropdown menus (No view active) gets focused(altough not rolled out). Same behaviour happens if roughly 40<y<60, so I know I am hitting good height. You can look at how it behaves here: output.webm 
      Dropdown 1 focuses at around 8 sec mark, and 13 sec mark it changes to second dropdown, defocusing first one, seemingly not registering any clinks inbetween.
       
      Have you ever encountered similar behaviour? I need to click the Key button, first on second line, with controlclick (or any other way not hijacking the mouse). I cant trigger that button by keyboard and There is no other control having control over it.
      Help
       
    • kcvinu
      By kcvinu
      Hi all,
      I have a button created with _GUICtrlButton_Create function. I know that this function returns a handle of button instead of an ID. So i have obtain control ID by calling _WinAPI_GetDlgCtrlID function. After that i have tried the GUICtrlSetBkColor function. But it didnt worked. Any suggestions will be appreciated. Thanks in advance. 
      Note : - The window which carries this button is not created with native gui create function. Instead, it is created with CreateWindowEx api function.
    • Skysnake
      By Skysnake
      I need to automate a specific GUI from a legacy system written in C.
      The spy tool gives me this

      I use this code
      Local $swintit = WinGetTitle("[active]") ConsoleWrite("active Window " & $swintit & @CRLF) If $swintit = "FILES NOTES" Then ; If $swintit = "FILES NOTES" Then ; got Window, now atomate ConsoleWrite("got Window " & @CRLF) ; now focus, then click :) ;EditPaste ;ControlCommand("FILES NOTES", "", 404, $acno) ; paste acno GUICtrlSetState(404, $GUI_Focus) ControlCommand("FILES NOTES", "", 404, $acno) ; paste acno GUICtrlSetState(401, $GUI_Focus) ControlClick("FILES NOTES", "", 401, $acno) ; click okay EndIf ; If $swintit = "FILES NOTES" Then The idea is to paste the acno value into the edit box, then click an Okay button.
      I get a console write that the active Window is as expected, but my loop completes without ever writing anything into the GUI.
      I also tried the control ID as text "404" - same result
      What am I missing?
      Skysnake
       
    • JNutt
      By JNutt
       

       
       
      I'm trying to use mouseclick in a panel above.  I want to click on a list item, such as 'Estimated'.  (I've given up on trying to use control click for this).  I'm using window info coordinates from 'Control' tab.

      ; click 'Columns' WinActivate("Innovaya Studio with Sage (Archtectural 2017_V1.invx") MouseClick("primary", 292, 88, 1, 1) WinActivate("Select Browsing Properties") Sleep(1000) MouseClick("primary", 27, 70, 0,0) Sleep(2000) Send("{TAB}{TAB}{TAB}{TAB}{TAB}") Sleep(1000) Send("{ENTER}") ControlClick( But when I used the code Autoit doesn't click where the coordinates are.  In the scipts it is the second MouseClick that won't work.  Any ideas?
×