Jump to content

Make a loop run from 1 to 100 and wait for 10 first commands done then continue.


Recommended Posts

Hi everyone.

I want to ask about this

I want it runs from 1 to 100 and It opens 10 firefox profiles then access youtube. After I close a firefox window, the loop runs and wait for another window close until loop ends

I have a loop like this.

Func launch()
   Local $from = Int(GUICtrlRead($input1))
   Local $to = Int(GUICtrlRead($input2))
   If $to <> "" Then
        While $from <= $to
            Local $profile = $to
            _RunDos("start firefox.exe -p " & $profile & " -no-remote youtube.com")
            $to=$to+1
        WEnd
  Else
        Local $profile = $to
        _RunDos("start firefox.exe -p " & $profile & " -no-remote youtube.com")
  EndIf
EndFunc

Is there any solution?

Thank you!

Link to post
Share on other sites
  • Moderators

ThePoro,

Quote

 It opens 10 firefox profiles then access youtube

And just why do you want to do this? Whose profiles are they and why do you need to access YouTube using these different profiles?

M23

P.S. And just to be absolutely clear - this is the Mod team determining the legality of the thread, so everyone else please keep out.

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites
  • Moderators

ThePora,

So you are trying to cheat to get your content liked - not something we are prepared to support. Thread locked.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By edubensa
      Hi! Can someone help me with this? I upgraded from SciTe Edit Lite to full version. Now every time I edit a script it opens on a new SciTe tab, but I want it opens on a new window like before the upgrade. Can someone help me with that? Thanks!!
    • By ahha
      I'm using Firefox however it shows up in all browsers.  When you hover over a hyperlink and the cursor turns to a hand then in the lower left corner of the browser the actual web URL link pops up.  How does one capture that text programmatically?  I know in FF I can right click and "Copy Link" I'm wondering if there is another way.
    • By goldstar
      hey . is it possible  send message to firefox extension  and receive too?
      what is simplest way 
       
    • By MakzNovice
      I have a simple code that takes file "C:\Temp\File1.txt" and pastes it in drop area of specific firefox location ( Note : The drag drop works manually meaning firefox window supports drag and drop)  . The return value is true with no error indicating that operation successful.
      The results are not getting updated in firefox window even after exe execution completion and sleep time 20secs.
      Attached my code snippet and _FileDragDrop.au3 + text file it works 
      #include "_FileDragDrop.au3" Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase Opt("MouseCoordMode", 0) ;1=absolute, 0=relative, 2=client $File1 = "E:\AutoIt\DragDropFile\File1.txt" $File2 = "E:\AutoIt\DragDropFile\File2.txt" If ProcessExists("Firefox.exe") Then $hWnd = WinGetHandle("Mozilla Firefox") ; My FF tab title substring WinActivate($hWnd) Else MsgBox(64,"Error","No Firefox window found",10) EndIf $hNPPlus=WinGetHandle("[CLASS:Notepad++]") WinActivate($hNPPlus) $iRet = _FileDragDrop($hNPPlus, $File1, 75, 274) ConsoleWrite("Return: "&$iRet&" @error="&@error&", @extended="&@extended&@CRLF) Sleep(20000) ;~ Above code to add in Notepad++ works fine ;~ Cordinate from drop file 1 - 75, 274 $iRet = _FileDragDrop($hWnd, $File1, 75, 274,'|',False) ConsoleWrite("Return: "&$iRet&" @error="&@error&", @extended="&@extended&@CRLF) Sleep(20000) ;~ Above code to add file in firefox with title Mozilla firefox DOES NOT work Exit
       
      Repose from code -->
      Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
      Return: True @error=0, @extended=0
      Return: True @error=0, @extended=0
       
      _FileDragDrop.au3 File1.txt
    • By mLipok
      wd_capabilities.au3 UDF was changed/modified/refactored .... and commited/merged (02-12-2021) to https://github.com/Danp2/WebDriver

      WARNING: Before you start using this UDF be sure you download the recent version from: https://github.com/Danp2/WebDriver
       
      ==================================================================================================

      Recently I start wd_capabilities.au3 project on my side.
      I think this is time to share to AutoIt community.
      Check attached UDF: wd_capabilities.au3

      Here is a scratch example showing how to use them:
      #include "wd_helper.au3" #include "wd_capabilities.au3" _Example() Func _Example() ........ ........ ........ _WD_Capabilities_Build_Arguments(Null) ; CLEANUP ARGS _WD_Capabilities_Build_Arguments('--headless') _WD_Capabilities_Build_Arguments('start-maximized') _WD_Capabilities_Build_Arguments('disable-infobars') _WD_Capabilities_Build_Arguments('user-data-dir', 'C:\Users\' & @UserName & '\AppData\Local\Google\Chrome\User Data\Default') Local $s_WD_Capabilities_Arguments = _WD_Capabilities_Build_Arguments(Default) ; GET ARGS _WD_Capabilities_Build_Preferences(Null) ; CLEANUP PREFS If $s_Download_dir Then _WD_Capabilities_Build_Preferences('download.default_directory', $s_Download_dir) Local $s_WD_Capabilities_Preferences = _WD_Capabilities_Build_Preferences(Default) ; GET PREFS Local $s_Desired_Capabilities = _WD_Capabilities_Build_JSON('chrome', $s_WD_Capabilities_Arguments, $s_WD_Capabilities_Preferences) Local $WD_SESSION = _WD_CreateSession($s_Desired_Capabilities) ........ ........ ........ EndFunc  
      I plan to publish the code on GitHub.
      In the indefinite future, when the project becomes more functional, if @Danp2 accepts it, I hope it may be included in the main WebDriver UDF.

      I am waiting for yours feedback and help in the further development of this project.

      REMARK 1:
      As so far this UDF only supports GoogleChrome.
      Adding support for other browsers shouldn't be difficult, I just didn't need to.

      REMARK 2:
      For now, this project is working but still as a early BETA, so please do not discuss, ask questions, or post examples or snippets of code that pertain to any function of this UDF in other part of this forum, until it is found acceptable. Simply: discusion and tests only here in this topic.


      Regards,
      @mLipok
       
×
×
  • Create New...