Is it possible to get a variable on your For..Next loop?
Local $Lines1 = _FileCountLines(C:\temp\test.txt) Local $linesToCount2 = $Lines1 + 2 $var = Number($linesToCount2) For $count = 1 To _FileCountLines($FileRead2) Step 1 For $i = $var To $count Next ;Code does stuff here Next Somehow my code doesn't work even though I thought I could convert the variable to a Integer / Number.
This code I posted above does not move to the next value.
But the code below does... why is that?
For $count = 1 To _FileCountLines($FileRead2) Step 1 For $i = 2 To $count Next ;Code does stuff here Next
Why is the For loop resetting itself?
Is it because the program does not cache the variable and needs to keep on acquiring this variable each time?
If so , how would you make this variable static?
I got that func
Func makeHelpImgGUI($title,$width,$height,$img) $img = GUICtrlCreatePic("",20,40,$width,$height) _ResourceSetImageToCtrl($img, "HERE") EndFunc and I call this func like that
so what is the problem in the parameter where is - "HERE" I need value of img but passed as string
so $img = $SETTINGS_JPG and how make it "SETTINGS_JPG"
I tried something like that but not work
Func makeHelpImgGUI($title,$width,$height,$img) $name_str = String($img) $name_str = StringTrimLeft ($name_str, 1 ) $img = GUICtrlCreatePic("",20,40,$width,$height) _ResourceSetImageToCtrl($img, $name_str) EndFunc
I'm having a problem whit winwait on firefoxscreens whit the same title and text.
On mine quest on this forum and internet I've found some work around and solutions.
unfortunaly This wasn't working for me.
I've tried searching tru winlist or finding some unique text but wasn't finding any solution.
Does anyone know how to get the wright handle?
I just want to move the browser to the right place in the end whit WinMove.
thnx in advanced.
#include <Array.au3> Global $A_URL = _ [["url1" , "same_title"] , _ ["url2", "same_title"] , _ ["url3" , "other_title" ] , _ ["url4" , "other_title" ]] ;~ _ArrayDisplay($A_URL) ;-----kill all firefox.exe ;~ Run("taskkill /IM firefox.exe /F", "", @SW_HIDE) ;Sleep(5000) For $i = 0 To 1 ConsoleWrite("running 1 : " & $i & @CRLF) Local $ID = ShellExecute("firefox.exe", "-new-window " & $A_URL[$i] ,"C:\Program Files\Mozilla Firefox" ) ConsoleWrite("$ID = " & $ID & @CRLF) Next sleep(200) ;~ Local $screen1HWND = WinWait($A_URL,"") ;~ If Not WinActive($screen1HWND) Then WinActivate($screen1HWND) ;~ ConsoleWrite("$screen1HWND = " & $screen1HWND & @CRLF) ;~ Local $screen2HWND = WinWait($A_URL,"") ;~ If Not WinActive($screen2HWND) Then WinActivate($screen2HWND) ;~ ConsoleWrite("$screen2HWND = " & $screen2HWND & @CRLF) $sWinTitle = $A_URL $avWinList = WinList($sWinTitle) For $n = 1 to $avWinList ConsoleWrite("Window " & $n & ": Text: " & WinGetText($avWinList[$n]) & @LF) Next For $i = 0 To 1 ;~ WinWait("title1", "", 10) ;~ WinActive("title1", "") ;~ WinMove ("title1", "", $i , $i ) Next
This script used to work on an older version of AutoIT. Currently I am running AutoIT v18.104.22.168 and it's failing.
Func PublicIP() ;Post public facing IP address Local $url = 'https://www.google.com/search?client=opera&q=what+is+my+ip&sourceid=opera&ie=UTF-8&oe=UTF-8' Local $getIPaddress = BinaryToString(InetRead($url)) Local $sStart = 'clamp:2">' Local $sEnd = '</div>' Local $ipaddress = _StringBetween($getIPaddress, $sStart, $sEnd For $i In $ipaddress MsgBox(0, 'External IP', "Your public IP address is " & $i) Next EndFunc ;==>PublicIP The console output shows:
"C:\Users\user\Documents\AutoIT\Scripts\WSI Tools.au3" (197) : ==> Variable must be of type "Object".: For $i In $ipaddress For $i In $ipaddress^ ERROR ->14:12:16 AutoIt3.exe ended.rc:1 +>14:12:16 AutoIt3Wrapper Finished. >Exit code: 1 Time: 9.811
Hi, I am stuck on a GUI problem and would like your help to solve it.
I am trying to automate the SoundWire Server app to match my current system volume level while it is minimized to the notification area (so no clicking or stealing focus),
I can already get the handle and alter the tracker position by sending a WM_SETPOS message, but somehow the actual volume is not changed: I think I need to do something else to trigger the event handler for the value change and propagate it correctly.
This is the control summary from Au3 info:
>>>> Window <<<< Title: SoundWire Server Class: #32770 Position: 441, 218 Size: 566, 429 Style: 0x94CA00C4 ExStyle: 0x00050101 Handle: 0x0000000000510E12 >>>> Control <<<< Class: msctls_trackbar32 Instance: 4 ClassnameNN: msctls_trackbar324 Name: Advanced (Class): [CLASS:msctls_trackbar32; INSTANCE:4] ID: 6002 Text: Position: 51, 222 Size: 47, 126 ControlClick Coords: 1, 101 Style: 0x5001000A ExStyle: 0x00000000 Handle: 0x00000000001234C8 >>>> Mouse <<<< Position: 496, 567 Cursor ID: 2 Color: 0xF0F0F0 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< Default multimedia device Tray on Start Static Server Address: 192.168.1.8 Status: Connected to B9K~OP3 Audio Output Audio Input Level Record to File Input Select: 44.1 kHz Minimize to Master Volume Mute >>>> Hidden Text <<<< Slider2 Mute OK Cancel Label Balance Slider1 Volume Front L/R Fr C/LFE Side L/R Back L/R
I am attaching the program in question so you don't have to install it (i don't know if it is portable enough, tough):
Thanks in advance and I hope I didn't post in the wrong section