SleepyXtreme Posted April 12, 2007 Share Posted April 12, 2007 CODE $WindowList = WinList() For $x = 1 to $WindowList[0][0] $temp=$WindowList[$x][0] if $WindowList[$x+1][0] = $temp Then $WindowList[$x+1][0] = $WindowList[$x+1][0] & " " &$x+1 EndIf Next I have a feeling I'm doing something wrong cause it doesn't work lol I want to rename the windows in WinList() that have the same title to be like Internet explorer 1, Internet explorer 2, Internet explorer 3, Internet explorer 4, if there are,for instance, 4 windows with the title Internet explorer. Link to comment Share on other sites More sharing options...
SleepyXtreme Posted April 12, 2007 Author Share Posted April 12, 2007 BUMP, someone please help! Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 12, 2007 Share Posted April 12, 2007 All that does is change the COPY of window title in your array, not the title of the actual window. Maybe: $WindowList = WinList() For $x = 1 To $WindowList[0][0] $temp = $WindowList[$x][0] If $WindowList[$x + 1][0] = $temp Then $NewTitle = $WindowList[$x + 1][0] & " " & $x + 1 $WindowList[$x + 1][0] = $NewTitle WinSetTitle($WindowList[$x + 1][1], "", $NewTitle) EndIf Next Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
evilertoaster Posted April 12, 2007 Share Posted April 12, 2007 $list= WinList() for $x=1 to $list[0][0] for $y=2 to $list[0][0] if $list[$x][0]= $list[$y][0] and $list[$x][0]<>"" then WinSetTitle($list[$y][0],"",$list[$y][0] & Random(0,10)) EndIf Next Next Logic is probly somthing liek that...you'll probably want to change it to only check visable windows and add a seqentail number rather than a random. Link to comment Share on other sites More sharing options...
SleepyXtreme Posted April 12, 2007 Author Share Posted April 12, 2007 The only problem is that WinSetTitle($WindowList[$x + 1][1], "", $NewTitle) only recognizes one window at a time so i have to repeat the renaming command somehow Link to comment Share on other sites More sharing options...
evilertoaster Posted April 12, 2007 Share Posted April 12, 2007 The nested for statment i posted checks each title agianst each other title...really it works Link to comment Share on other sites More sharing options...
SleepyXtreme Posted April 12, 2007 Author Share Posted April 12, 2007 I tried it but it only changes the name of one window...... CODE Global $WindowList = WinList() for $x=1 to $WindowList[0][0] for $y=2 to $WindowList[0][0] If $WindowList[$x][0] <> "" AND BitAnd( WinGetState($WindowList[$x][1]), 2 ) AND $WindowList[$x][0] <> "Program Manager"Then WinSetTitle($WindowList[$y][0],"",$WindowList[$y][0] & Random(0,10)) EndIf Next Next ; For $x = 1 to $WindowList[0][0] ; If $WindowList[$x][0] <> "" AND BitAnd( WinGetState($WindowList[$x][1]), 2 ) AND $WindowList[$x][0] <> "Program Manager"Then ; For $y= 1 to $WindowList[0][0] ; If $WindowList[$x][0]=$WindowList[$y][0] Then ; WinSetTitle($WindowList[$y][0], "", $WindowList[$y][0] & " " & Random(0,10)) ; EndIf ; Next ; EndIf ; Next For $x = 1 to $WindowList[0][0] If $WindowList[$x][0] <> "" AND BitAnd( WinGetState($WindowList[$x][1]), 2 ) AND $WindowList[$x][0] <> "Program Manager"Then WinSetState($WindowList[$x][0], "", @SW_HIDE) EndIf Next Link to comment Share on other sites More sharing options...
evilertoaster Posted April 12, 2007 Share Posted April 12, 2007 may stem from the fact that when renaming the window you have to do it based on title (which is ambigius). Maybe try decremitnting the loop counter if it does find an identical window, that way it will run that same loop agian. Link to comment Share on other sites More sharing options...
SleepyXtreme Posted April 12, 2007 Author Share Posted April 12, 2007 do you think you can add the code to it cause i'm tired of playingwith it Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now