Jump to content

BogdanNicolescu

Active Members
  • Posts

    77
  • Joined

  • Last visited

Recent Profile Visitors

738 profile views

BogdanNicolescu's Achievements

  1. It's nothing too complicated stuff (the task i mean) that i want to put this code to work, but the code it's self, is bending my brian :)) That's the complicated stuff. I think of it being hard now, but when i will get the hang of it and understand the logic behind all lines, will be a breeze
  2. My brain is high on fire ... i got something working. Hope i can manage myself from here :))
  3. What i was missing was this: #include "CUIAutomation2.au3" But now if i want to integrate it into another script, how can i do it? I get all sort of errors ...
  4. What represent this: "error: 'Return' not allowed from global scope."? P.S. I still get errors, but i'm starting to "delete" them ... kinda, don't know if this type of "delete" is the solution. And by delete i mean i started to declare them globally.
  5. Using this thread: Using UI Automation Code in AutoIt I came up with this code: ; --- Find window/control --- ConsoleWrite( "--- Find window/control ---" & @CRLF ) While 1 Local $pCondition0 $oUIAutomation.CreatePropertyCondition( $UIA_ClassNamePropertyId, "Chrome_WidgetWin_1", $pCondition0 ) If Not $pCondition0 Then Return ConsoleWrite( "$pCondition0 ERR" & @CRLF ) ConsoleWrite( "$pCondition0 OK" & @CRLF ) Local $pPane1, $oPane1 $oDesktop.FindFirst( $TreeScope_Children, $pCondition0, $pPane1 ) $oPane1 = ObjCreateInterface( $pPane1, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement ) If Not IsObj( $oPane1 ) Then Return ConsoleWrite( "$oPane1 ERR" & @CRLF ) ConsoleWrite( "$oPane1 OK" & @CRLF ) ; --- Find window/control --- ConsoleWrite( "--- Find window/control ---" & @CRLF ) Local $pCondition1, $pCondition2, $pAndCondition2 $oUIAutomation.CreatePropertyCondition( $UIA_ControlTypePropertyId, $UIA_MenuItemControlTypeId, $pCondition1 ) $oUIAutomation.CreatePropertyCondition( $UIA_NamePropertyId, "FireShot - Capture page Are acces la acest site", $pCondition2 ) $oUIAutomation.CreateAndCondition( $pCondition1, $pCondition2, $pAndCondition2 ) If Not $pAndCondition2 Then Return ConsoleWrite( "$pAndCondition2 ERR" & @CRLF ) ConsoleWrite( "$pAndCondition2 OK" & @CRLF ) Local $pMenuItem1, $oMenuItem1 $oPane1.FindFirst( $TreeScope_Descendants, $pAndCondition2, $pMenuItem1 ) $oMenuItem1 = ObjCreateInterface( $pMenuItem1, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement ) If Not IsObj( $oMenuItem1 ) Then Return ConsoleWrite( "$oMenuItem1 ERR" & @CRLF ) ConsoleWrite( "$oMenuItem1 OK" & @CRLF ) ; --- Invoke Pattern (action) Object --- ConsoleWrite( "--- Invoke Pattern (action) Object ---" & @CRLF ) Local $pInvokePattern1, $oInvokePattern1 $oMenuItem1.GetCurrentPattern( $UIA_InvokePatternId, $pInvokePattern1 ) $oInvokePattern1 = ObjCreateInterface( $pInvokePattern1, $sIID_IUIAutomationInvokePattern, $dtag_IUIAutomationInvokePattern ) If Not IsObj( $oInvokePattern1 ) Then Return ConsoleWrite( "$oInvokePattern1 ERR" & @CRLF ) ConsoleWrite( "$oInvokePattern1 OK" & @CRLF ) ; --- Invoke Pattern (action) Methods --- ConsoleWrite( "--- Invoke Pattern (action) Methods ---" & @CRLF ) $oInvokePattern1.Invoke() ConsoleWrite( "$oInvokePattern1.Invoke()" & @CRLF ) WEnd ; Code corrections: ; UIA_Constants.au3 path ; UIA_Functions.au3 path ; UIA_SafeArray.au3 path ; UIA_Variant.au3 path ; Code to open target appl ; If it isn't already open ; Create undeclared variables ; There should be very few ; Delete double declared variables ; There should be very few ; Window, Pane, Parent and Control names ; Most names should be correct ; Fill out Pattern (action) Method parameters ; See Microsoft docu for the Pattern Method ; Place the code inside a function ; Necessary due to Return statements I don't understeand, what am i not reading? The task is simple: - Instead of going to click on that extension with coord; - I want to tell AutoIT: Hey, do you see that extension? If yes, click on it. But i don't understeand what i should do.
  6. I've read the post from Chrome - Clicking an extension and i don't understead the part after this What am i supposed to do after that? I clicked the Corrections after that i hit Copy all items after that i pasted it in SciTE, Save it and when i run it i get all sort of errors.
  7. Pro Noob question ... How/where do i download these files from?
  8. How do i install it? You forgot to mention this bit of info :)) I get this error: L.E.: Solved the problem. I would tell if i had any sort of tracking the steps, but i definetly found out how to make it to work. Man, i wish i had it recorded ...
  9. Sorry to be so dropped in head, but this is where the code should be plastered? Sleep(1000) ؟؟؟code??? ConsoleWrite("Pass#" & $i & @CRLF) I've worked on this way to much than i should have to :)) 🤪
  10. Finally, after 3hrs, this is what i came up with: Global $Paused=True HotKeySet("{F6}", "TogglePause") HotKeySet("{F7}", "Terminate") $i = 0 While $i < 10 If Not $Paused Then ;to see if paused or not Sleep(400) Send("{DOWN}") Sleep(400) Send("{APPSKEY}") Sleep(400) Send("{DOWN 4}") Sleep(400) Send("{ENTER}") Sleep(3000) Send("{ENTER}") Sleep(400) $i = ( $i + 1 ) EndIf WEnd Func TogglePause() $Paused= Not $Paused;if true set to false and vice versa EndFunc Func Terminate() ;exit Exit EndFunc Global $Paused=True HotKeySet("{F6}", "TogglePause") HotKeySet("{F7}", "Terminate") $i = 0 <= this i don't know what is doing While $i < 10 <= this is for the loop (kinda) If Not $Paused Then ;to see if paused or not <= this is to check if it is paused or not ... code ..... $i = ( $i + 1 ) <= this is part of "this i don't know what is doing" EndIf <= this is part of "this is to check if it is paused or not" WEnd <= this is part of "this is for the loop (kinda)" Func TogglePause() $Paused= Not $Paused;if true set to false and vice versa EndFunc Func Terminate() ;exit Exit EndFunc
  11. Coming from here i try this: Global $Paused=True HotKeySet("{F6}", "TogglePause") HotKeySet("{F7}", "Terminate") $i = 0 $repeats=InputBox("Repeats", "How many Loops?", "") While 2 If Not $Paused Then ;to see if paused or not Sleep(400) Send("{DOWN}") Sleep(400) Send("{APPSKEY}") Sleep(400) Send("{DOWN 4}") Sleep(400) Send("{ENTER}") Sleep(3000) Send("{ENTER}") Sleep(400) $i = ( $i + 1 ) EndIf WEnd Func TogglePause() $Paused= Not $Paused;if true set to false and vice versa EndFunc Func Terminate() ;exit Exit EndFunc What am i doing wrong? What i want to achive is to have a way to tell the script how many times to loop AND!! to have a way to pause it. I will play around with it to see what i can come up with ...
  12. I'm a noob at this scripting thingy, can you show me some examples how to use it? From what i understand, the hook.dll and script(what script?) must be in the same what folder? In the AutoIt3\Include folder? Thank you.
  13. Ok, if you really want to see what ițm working on, this is a script for copy-paste: Global $Paused=True , $counter = 34 HotKeySet("{F6}", "TogglePause") HotKeySet("{F7}", "Terminate") While 1 If Not $Paused Then ;to see if paused or not Sleep(20) MouseClick("left",660,57,2) Sleep(20) Send("^x") Sleep(20) MouseWheel("down", 1) Sleep(20) MouseClick("left",65,207,1) Sleep(20) Send ("^v") Sleep(20) MouseWheel("down", 1) Sleep(100) MouseClick("left",65,203,1) Sleep(20) EndIf Sleep(10) WEnd Func TogglePause() $Paused= Not $Paused;if true set to false and vice versa EndFunc Func Terminate() ;exit Exit EndFunc And wanted to have a middle mouse button as a pause button instead of F6 which is between F5 and F7. It's an old work in progress.
  14. Hi Jos, As i said above, the accomplishment woud be to learn how to set a mouse key do do something. I read the help files, and some (really old) threads, tried some variations, but i must do something wrong that i can't make it run. Hoped that someone who has encountered this case has figure it out already. Of course, i will continue to do my own research, ițm not that lazy, but i wanted to see other opinions on this too.
  15. You gave me some thinking to do. Given the "nice experience" you are talking about, should i consider making a new account? Thank you for your time. Bogdan
×
×
  • Create New...