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

    • Yirrlaar
      By Yirrlaar
      #Include <WinAPI.au3> local $ClassName = _WinAPI_GetClassName(WinGetHandle(WinGetTitle("[ACTIVE]"))) ControlClick(WinGetTitle("[ACTIVE]"), "", "[CLASS:"&$ClassName&"; INSTANCE:1]", "primary") When I am running this script it just gives me a ConsoleWrite output of "0x001D04A8"
      When using "AutoIT v3 Window Info" all the info I need for the ControlClick is there and displayed perfectly as if I typed it in normally.
      Upon click the button it should be clicking it, I see the following inn the console window:
      If I replace the $ClassName with the actual ClassName of "WindowsForms10.BUTTON.app.0.3296db7_r14_ad1" it works just fine, any ideas???
    • Rocker
      By Rocker
      I apologize for my poor coding skills, but only on occasion do I have a need to automate a repetitious task to save time.  In a nutshell the following code is supposed to go to a website, save the site using Scrapbook (a plugin used by an older version of Firefox), rename the folder in Windows Explorer that Scrapbook assigns a random name for and then moves on to the next website, of which there are hundreds.  Everything works, except after the address bar gets populated with the URL, it's like the ENTER key never gets pushed.  The weird thing is, this worked yesterday before I left to go home and when I came in this morning it didn't work.  The next thing I'll be trying to learn is to loop this with a the list of the websites.  Thank you for your help!
      WinActivate( "[CLASS:MozillaWindowClass]" ) ;Apply focus to the open Mozilla firefox window Sleep(500) Send("^k") ;Apply focus to the address bar Sleep(500) Send("www.WEBSITE.com {ENTER}") ;Send the website to the address bar Sleep(10000) ;Wait for the website to fully open Send("!c") ;Opens the drop down menu for Scrapbook Sleep(2000) Send("{ENTER}") ;Selects the default drop down selection of save Sleep(20000) WinActivate( "[CLASS:CabinetWClass]" ) ;Applies focus to the open Windows Explorer window where the websites are saved Sleep(1000) Send("{SPACE}") ; Selects a folder in the folders list Sleep(200) Send("{HOME}") ;Moves to the top folder Sleep(200) Send("{F2}") ;Keyboard shortcut to rename the folder Sleep(200) Send("www.WEBSITE.com {ENTER}") ;Applies the new name to the folder  
    • Tats
      By Tats
      Hi everyone,
      I have a problem with ControlClick function. It doesn't work no matter how I tried all the possible combination of the parameters.
      Below is the scripts of possible parameter combination:
      ;ControlClick("title","text","controlID ","button","clicks","x","y") ;title= Title, Class, Handle ;controlID= Class, ClassNN, Instance ;Title here is empty when I check it with AutoIt Info ControlClick("", "", "[ScreenKeyboard::Button18]", "left", "1", "230","890") ControlClick("", "", "[CLASS:ScreenKeyboard::Button; INSTANCE:18]", "left", "1", "230","890") ControlClick("", "", "[INSTANCE:18]", "left", "1", "230","890") ;Title here is the Class of the window ControlClick("[ScreenKeyboard::SKFrame]", "", "[ScreenKeyboard::Button18]", "left", "1", "230","890") ControlClick("[ScreenKeyboard::SKFrame]", "", "[CLASS:ScreenKeyboard::Button; INSTANCE:18]", "left", "1", "230","890") ControlClick("[ScreenKeyboard::SKFrame]", "", "[INSTANCE:18]", "left", "1", "230","890") ;Title here is the Handle of the window ControlClick("[0x000907A0]", "", "[ScreenKeyboard::Button18]", "left", "1", "230","890") ControlClick("[0x000907A0]", "", "[CLASS:ScreenKeyboard::Button; INSTANCE:18]", "left", "1", "230","890") ControlClick("[0x000907A0]", "", "[INSTANCE:18]", "left", "1", "230","890") Am I coding it correctly?
      Thanks
    • 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
       
×