wazer Posted September 11, 2009 Share Posted September 11, 2009 Hi foks Im having a hard time getting this script to work. What its supposed to do is right click on taskbar select new toolbar and add my quick launch folder im doing this because i want the old quick launch for my unattended setup. OPT("TrayIconHide", 1) MouseClick("secondary", 0, @DesktopHeight, 1, 0) Send("tn") WinWait("New Toolbar") WinActivate("New Toolbar") ControlSetText("New Toolbar", "", "Edit1", "%userprofile%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch") ControlClick("New Toolbar", "", "Button1") While 1 Sleep(100) $QUICKLAUNCH = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:ToolbarWindow32; TEXT:Quick Launch]") If Not @error Then ExitLoop WEnd MouseClick("secondary", $QUICKLAUNCH[0] - 5, @DesktopHeight - $QUICKLAUNCH[3] / 2, 1, 0) Send("x") MouseClick("secondary", $QUICKLAUNCH[0] - 5, @DesktopHeight - $QUICKLAUNCH[3] / 2, 1, 0) Send("w") $QUICKLAUNCH = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:ToolbarWindow32; TEXT:Quick Launch]") $TRAY = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:ReBarWindow32]") MouseClickDrag("left", $QUICKLAUNCH[0] - 5, @DesktopHeight - $QUICKLAUNCH[3] / 2, $TRAY[0], @DesktopHeight - $QUICKLAUNCH[3] / 2, 0) $CURRENTAPPS = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:MSTaskListWClass; TEXT:Running applications]") MouseClickDrag("left", $CURRENTAPPS[0] - 5, @DesktopHeight - $CURRENTAPPS[3] / 2, $TRAY[0] + 105, @DesktopHeight - $CURRENTAPPS[3] / 2, 0) Any help would be appreciated and btw if theres someone that has already done this please feel free to share if you want Link to comment Share on other sites More sharing options...
ACalcutt Posted September 12, 2009 Share Posted September 12, 2009 This is based off an old function for my PrepSys program. It needed to be modified a little to work with windows 7 _TaskToolbarWin7("Shell:Quick Launch") Func _TaskToolbarWin7($toolbardir) ;----------------------------------------------------------------------------- ; AutoIt Version: 3.3.0.0 ; Author:Andrew Calcutt Date:09/12/2009 ; Script Function: Creates a toolbar in the taskbar (Windows 7 version) ;----------------------------------------------------------------------------- MouseClick("right", 0, @DesktopHeight) Send("{DOWN}{RIGHT}{UP}{ENTER}") WinWaitActive("New Toolbar") ControlSetText("New Toolbar", "", "Edit1", $toolbardir) ControlClick("New Toolbar", "", "Button1") EndFunc ;==>_TaskToolbar At the time I made the origional prepsys function I seem to remember trying to find a better way to do this but did not have much luck. I think you are going to have trouble getting the quick launch to look the way you want once it gets created. I had tried to do it by registry, but the toolbar key did not seem editable. Andrew Calcutt Http://www.Vistumbler.net Http://www.TechIdiots.net Its not an error, its a undocumented feature Link to comment Share on other sites More sharing options...
ACalcutt Posted September 12, 2009 Share Posted September 12, 2009 (edited) How about this....this worked for me ;------------------------------------------------------------------ ; AutoIt Version: 3.3.0.0 ; Author: Andrew Calcutt, wazer ; Last Edited: 09/12/2009 ; Script Function: Adds Quick Launch Toolbar ;------------------------------------------------------------------ ;Unlock Taskbar _ToggleTaskbarLock() ;Create Quicklaunch Toolbar _TaskToolbarWin7("Shell:Quick Launch") ;Get Quick Launch current postion While 1 Sleep(100) $QUICKLAUNCH = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:ToolbarWindow32; TEXT:Quick Launch]") If Not @error Then ExitLoop WEnd $TaskBar_CenterHeight = @DesktopHeight - ($QUICKLAUNCH[3] / 2) ;Hide "Quick Launch" toolbar text MouseClick("right", $QUICKLAUNCH[0] - 5, $TaskBar_CenterHeight, 1, 0) Send("x") ;Hide "Quick Launch" toolbar title MouseClick("right", $QUICKLAUNCH[0] - 5, $TaskBar_CenterHeight, 1, 0) Send("w") ;Move "Quick Launch" toolbar $QUICKLAUNCH = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:ToolbarWindow32; TEXT:Quick Launch]") $TRAY = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:ReBarWindow32]") MouseClickDrag("left", $QUICKLAUNCH[0] - 5, $TaskBar_CenterHeight, $TRAY[0] + 5, $TaskBar_CenterHeight, 0) ;Move "Current Apps" bar $CURRENTAPPS = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:MSTaskListWClass; TEXT:Running applications]") MouseClickDrag("left", $CURRENTAPPS[0] - 5, $TaskBar_CenterHeight, $TRAY[0] + 105, $TaskBar_CenterHeight, 0) ;Lock Taskbar _ToggleTaskbarLock() Func _TaskToolbarWin7($toolbardir) MouseClick("right", 0, @DesktopHeight) Send("{DOWN}{RIGHT}{UP}{ENTER}") WinWaitActive("New Toolbar") ControlSetText("New Toolbar", "", "Edit1", $toolbardir) ControlClick("New Toolbar", "", "Button1") EndFunc ;==>_TaskToolbarWin7 Func _ToggleTaskbarLock() MouseClick("right", 0, @DesktopHeight) Send("{UP}{UP}{ENTER}") EndFunc ;==>_ToggleTaskbarLock The only issue I had was getting the center height of the CURRENTAPPS bar. I ended up just using the the QUICKLANUCH center height. (I think my problem was cause by the taskbar squishing all my running programs to the point that there were multiple rows of programs) Edited September 12, 2009 by ACalcutt Andrew Calcutt Http://www.Vistumbler.net Http://www.TechIdiots.net Its not an error, its a undocumented feature Link to comment Share on other sites More sharing options...
ACalcutt Posted September 12, 2009 Share Posted September 12, 2009 (edited) How about this....this worked for me expandcollapse popup;------------------------------------------------------------------ ; AutoIt Version: 3.3.0.0 ; Author: Andrew Calcutt, wazer ; Last Edited: 09/12/2009 ; Script Function: Adds Quick Launch Toolbar ;------------------------------------------------------------------ ;Unlock Taskbar _ToggleTaskbarLock() ;Create Quicklaunch Toolbar _TaskToolbarWin7("Shell:Quick Launch") ;Get Quick Launch current postion While 1 Sleep(100) $QUICKLAUNCH = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:ToolbarWindow32; TEXT:Quick Launch]") If Not @error Then ExitLoop WEnd $TaskBar_CenterHeight = @DesktopHeight - ($QUICKLAUNCH[3] / 2) ;Hide "Quick Launch" toolbar text MouseClick("right", $QUICKLAUNCH[0] - 5, $TaskBar_CenterHeight, 1, 0) Send("x") ;Hide "Quick Launch" toolbar title MouseClick("right", $QUICKLAUNCH[0] - 5, $TaskBar_CenterHeight, 1, 0) Send("w") ;Move "Quick Launch" toolbar $QUICKLAUNCH = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:ToolbarWindow32; TEXT:Quick Launch]") $TRAY = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:ReBarWindow32]") MouseClickDrag("left", $QUICKLAUNCH[0] - 5, $TaskBar_CenterHeight, $TRAY[0] + 5, $TaskBar_CenterHeight, 0) ;Move "Current Apps" bar $CURRENTAPPS = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:MSTaskListWClass; TEXT:Running applications]") MouseClickDrag("left", $CURRENTAPPS[0] - 5, $TaskBar_CenterHeight, $TRAY[0] + 105, $TaskBar_CenterHeight, 0) ;Lock Taskbar _ToggleTaskbarLock() Func _TaskToolbarWin7($toolbardir) MouseClick("right", 0, @DesktopHeight) Send("{DOWN}{RIGHT}{UP}{ENTER}") WinWaitActive("New Toolbar") ControlSetText("New Toolbar", "", "Edit1", $toolbardir) ControlClick("New Toolbar", "", "Button1") EndFunc ;==>_TaskToolbarWin7 Func _ToggleTaskbarLock() MouseClick("right", 0, @DesktopHeight) Send("{UP}{UP}{ENTER}") EndFunc ;==>_ToggleTaskbarLock The only issue I had was getting the center height of the CURRENTAPPS bar. I ended up just using the the QUICKLANUCH center height. (I think my problem was cause by the taskbar squishing all my running programs to the point that there were multiple rows of programs) Edited September 12, 2009 by ACalcutt Andrew Calcutt Http://www.Vistumbler.net Http://www.TechIdiots.net Its not an error, its a undocumented feature Link to comment Share on other sites More sharing options...
wazer Posted September 12, 2009 Author Share Posted September 12, 2009 (edited) The way i see it logically. It should only go to the appdata/roaming folder and select the quick launch folder, and not go into the quick launch folder and try selecting files/shortcuts. Your seem to be way more experience than me, i have tryed but without any luck . And the changes i made vent lost because of my harddrive "Thumbs up". possible you could do the changes for that ? EDIT: Theres already made a quick launch folder as standard in win7 %appdata%\Microsoft\Internet Explorer\Quick Launch How about this....this worked for me expandcollapse popup;------------------------------------------------------------------ ; AutoIt Version: 3.3.0.0 ; Author: Andrew Calcutt, wazer ; Last Edited: 09/12/2009 ; Script Function: Adds Quick Launch Toolbar ;------------------------------------------------------------------ ;Unlock Taskbar _ToggleTaskbarLock() ;Create Quicklaunch Toolbar _TaskToolbarWin7("Shell:Quick Launch") ;Get Quick Launch current postion While 1 Sleep(100) $QUICKLAUNCH = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:ToolbarWindow32; TEXT:Quick Launch]") If Not @error Then ExitLoop WEnd $TaskBar_CenterHeight = @DesktopHeight - ($QUICKLAUNCH[3] / 2) ;Hide "Quick Launch" toolbar text MouseClick("right", $QUICKLAUNCH[0] - 5, $TaskBar_CenterHeight, 1, 0) Send("x") ;Hide "Quick Launch" toolbar title MouseClick("right", $QUICKLAUNCH[0] - 5, $TaskBar_CenterHeight, 1, 0) Send("w") ;Move "Quick Launch" toolbar $QUICKLAUNCH = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:ToolbarWindow32; TEXT:Quick Launch]") $TRAY = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:ReBarWindow32]") MouseClickDrag("left", $QUICKLAUNCH[0] - 5, $TaskBar_CenterHeight, $TRAY[0] + 5, $TaskBar_CenterHeight, 0) ;Move "Current Apps" bar $CURRENTAPPS = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:MSTaskListWClass; TEXT:Running applications]") MouseClickDrag("left", $CURRENTAPPS[0] - 5, $TaskBar_CenterHeight, $TRAY[0] + 105, $TaskBar_CenterHeight, 0) ;Lock Taskbar _ToggleTaskbarLock() Func _TaskToolbarWin7($toolbardir) MouseClick("right", 0, @DesktopHeight) Send("{DOWN}{RIGHT}{UP}{ENTER}") WinWaitActive("New Toolbar") ControlSetText("New Toolbar", "", "Edit1", $toolbardir) ControlClick("New Toolbar", "", "Button1") EndFunc ;==>_TaskToolbarWin7 Func _ToggleTaskbarLock() MouseClick("right", 0, @DesktopHeight) Send("{UP}{UP}{ENTER}") EndFunc ;==>_ToggleTaskbarLock The only issue I had was getting the center height of the CURRENTAPPS bar. I ended up just using the the QUICKLANUCH center height. (I think my problem was cause by the taskbar squishing all my running programs to the point that there were multiple rows of programs) Edited September 12, 2009 by wazer Link to comment Share on other sites More sharing options...
ACalcutt Posted September 12, 2009 Share Posted September 12, 2009 (edited) The way i see it logically. It should only go to the appdata/roaming folder and select the quick launch folder, and not go into the quick launch folder and try selecting files/shortcuts.Your seem to be way more experience than me, i have tryed but without any luck . And the changes i made vent lost because of my harddrive "Thumbs up". possible you could do the changes for that ?EDIT:Theres already made a quick launch folder as standard in win7%appdata%\Microsoft\Internet Explorer\Quick LaunchI used "Shell:Quick Launch" in the above script. "Shell:Quick Launch" is the same thing as "%appdata%\Microsoft\Internet Explorer\Quick Launch" (I learned that when I was trying to set my own taskbar back to normal)Everything was working in that script when I tested it last night. Mostly due to the code you wrote (I would have never thought to configure the taskbars the way you had done it). I've been on these forums for 4 years now(damn)...and i still learn something new every time I come here. Edited September 12, 2009 by ACalcutt Andrew Calcutt Http://www.Vistumbler.net Http://www.TechIdiots.net Its not an error, its a undocumented feature Link to comment Share on other sites More sharing options...
wazer Posted September 13, 2009 Author Share Posted September 13, 2009 I used "Shell:Quick Launch" in the above script. "Shell:Quick Launch" is the same thing as "%appdata%\Microsoft\Internet Explorer\Quick Launch" (I learned that when I was trying to set my own taskbar back to normal)Everything was working in that script when I tested it last night. Mostly due to the code you wrote (I would have never thought to configure the taskbars the way you had done it). I've been on these forums for 4 years now(damn)...and i still learn something new every time I come here.Damn then i dont understand why it isnt working.. Hell i even tryed a reformat . after it vent lost. Just goes to new toolbar selection where i can select a folder to be the quick launch and thats it. Link to comment Share on other sites More sharing options...
wazer Posted September 13, 2009 Author Share Posted September 13, 2009 ohh well i said i didnt have premission to edit my comment . another question in wich resolution did you do this? and are u 100% sure that this is the code you used? Link to comment Share on other sites More sharing options...
wazer Posted September 13, 2009 Author Share Posted September 13, 2009 Finally i got it work, it appears that the english & danish versions dosnt share the same language codes. Im using Danish windows 7 so i had to make changes to get it to work.ChangesTaskToolbarWin7Func _TaskToolbarWin7($toolbardir) MouseClick("right", 0, @DesktopHeight) Send("{DOWN}{RIGHT}{UP}{ENTER}") WinWaitActive("Ny værktøjslinje") ControlSetText("Ny værktøjslinje", "", "Edit1", $toolbardir) ControlClick("Ny værktøjslinje", "", "Button1")Hide "Quick Launch" toolbar text + Hide "Quick Launch" toolbar title.I had to put sleep(100) else it would miss one of the cmds.Hide "Quick Launch" toolbar text MouseClick("right", $QUICKLAUNCH[0] - 5, $TaskBar_CenterHeight, 1, 0) Send("v{ENTER}") ;Hide "Quick Launch" toolbar title MouseClick("right", $QUICKLAUNCH[0] - 5, $TaskBar_CenterHeight, 1, 0) sleep(100) Send("v{UP}{ENTER}")Final version for Danish quick launch classic automatic enabler.expandcollapse popup;------------------------------------------------------------------ ; AutoIt Version: 3.3.0.0 ; Author: Andrew Calcutt, wazer ; Last Edited: 09/13/2009 ; Script Function: Adds Quick Launch Toolbar ;------------------------------------------------------------------ ;Unlock Taskbar _ToggleTaskbarLock() ;Create Quicklaunch Toolbar _TaskToolbarWin7("Shell:Quick Launch") ;Get Quick Launch current postion While 1 Sleep(100) $QUICKLAUNCH = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:ToolbarWindow32; TEXT:Quick Launch]") If Not @error Then ExitLoop WEnd $TaskBar_CenterHeight = @DesktopHeight - ($QUICKLAUNCH[3] / 2) ;Hide "Quick Launch" toolbar text MouseClick("right", $QUICKLAUNCH[0] - 5, $TaskBar_CenterHeight, 1, 0) Send("v{ENTER}") ;Hide "Quick Launch" toolbar title MouseClick("right", $QUICKLAUNCH[0] - 5, $TaskBar_CenterHeight, 1, 0) sleep(100) Send("v{UP}{ENTER}") ;Move "Quick Launch" toolbar $QUICKLAUNCH = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:ToolbarWindow32; TEXT:Quick Launch]") $TRAY = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:ReBarWindow32]") MouseClickDrag("left", $QUICKLAUNCH[0] - 5, $TaskBar_CenterHeight, $TRAY[0] + 5, $TaskBar_CenterHeight, 0) ;Move "Current Apps" bar $CURRENTAPPS = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:MSTaskListWClass; TEXT:Running applications]") MouseClickDrag("left", $CURRENTAPPS[0] - 5, $TaskBar_CenterHeight, $TRAY[0] + 105, $TaskBar_CenterHeight, 0) ;Lock Taskbar _ToggleTaskbarLock() Func _TaskToolbarWin7($toolbardir) MouseClick("right", 0, @DesktopHeight) Send("{DOWN}{RIGHT}{UP}{ENTER}") WinWaitActive("Ny værktøjslinje") ControlSetText("Ny værktøjslinje", "", "Edit1", $toolbardir) ControlClick("Ny værktøjslinje", "", "Button1") EndFunc ;==>_TaskToolbarWin7 Func _ToggleTaskbarLock() MouseClick("right", 0, @DesktopHeight) Send("{UP}{UP}{ENTER}") EndFunc ;==>_ToggleTaskbarLockWe are almost there. Now after this has completed im getting a error.AutoIt ErrorLine -1:Error: Subscript used with non-Aray variableThe error only comes when the script has been compiled. Not when launching thru scite pressing F5 Link to comment Share on other sites More sharing options...
urie Posted May 10, 2010 Share Posted May 10, 2010 How about this....this worked for meThe only issue I had was getting the center height of the CURRENTAPPS bar. I ended up just using the the QUICKLANUCH center height. (I think my problem was cause by the taskbar squishing all my running programs to the point that there were multiple rows of programs)Is there any way to alter this script to give options so as not to select show text and show title on taskbar ? 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