Abryce Posted August 6, 2010 Share Posted August 6, 2010 hello everyone, im kinda new to the whole script thing but iv been working on this script for afew weeks on and off, and i was wondering if you could have the ToolTip show the iTunes playing song, i dont even know how would i start besides "ToolTip("",0,0)". heres my scripted so far its probly a bit choppy but hey im new and im proud on getting this far thanks to the helpfiles. expandcollapse popup#cs -------------------------------------notes-------------------------- #ce #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> #include <GuiConstantsEx.au3> #include <Misc.au3> ;test1 #NoTrayIcon ;================================= itemtray =================================================== Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown. $pauseitem =TrayCreateItem("pause") $exititem = TrayCreateItem("Exit") TraySetToolTip("AVG") TraySetIcon("Shell32.dll",48) TraySetState() ; Show the tray icon ;============================== itemtray ========================================== ;================================= hotkeys ====================================== Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("{F7}", "hide2") HotKeySet("{F8}", "show2") HotKeySet("{F11}", "top") HotKeySet("{F12}", "notop") HotKeySet("{Home}", "bring") HotKeySet("{END}", "away") HotKeySet("{UP}", "up") HotKeySet("{RIGHT}", "right") HotKeySet("{Left}", "left") ;000000000000000000000 hotkeys 00000000000000 Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc ;hides gui bryce Func Hide2() WinSetState("Bryce's", "", @SW_HIDE) #NoTrayIcon EndFunc ;shows gui bryce func show2() WinSetState("Bryce's", "", @SW_SHOW) TraySetState (1) endfunc ;set top func top() WinSetState("Bryce's", "", @SW_RESTORE ) endfunc ;set no top func notop() WinSetState("Bryce's", "", @SW_MINIMIZE ) endfunc func bring() WinActivate("Bryce's","") endfunc ;itunes pause/play func away() WinSetState("Bryce's", "",@SW_MINIMIZE) endfunc func right() WinActivate("iTunes","") Send("{MEDIA_NEXT}") WinSetState("iTunes", "",@SW_MINIMIZE) ;WinSetState("Bryce's", "",@SW_MINIMIZE) endfunc func left() WinActivate("iTunes","") Send("{MEDIA_PREV}") WinSetState("iTunes", "",@SW_MINIMIZE) ;WinSetState("Bryce's", "",@SW_MINIMIZE) endfunc func up() WinActivate("iTunes","") Send("{MEDIA_PLAY_PAUSE}") WinSetState("iTunes", "",@SW_MINIMIZE) ;WinSetState("Bryce's", "",@SW_MINIMIZE) endfunc ;000000000000000000000 hotkeys END 00000000000000 ;================================= hotkeys END ====================================== ;============================= #cs $toggle = 0 While 1 $msg = TrayGetMsg() Select Case $msg = 0 Sleep(1000) If $toggle = 0 Then TraySetState() ; Show the tray icon $toggle = 1 Else TraySetState(2) ; Hide the tray icon $toggle = 0 EndIF Case $msg = $exititem ExitLoop EndSelect wend #ce ;test end ;============================== buttons ============================================== #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("Bryce's", 400, 320) $mFileMenu = GUICtrlCreateMenu("&File") ;++++row 1++++++ $Button1 = GUICtrlCreateButton("exit", 0, 0, 75, 25, $WS_GROUP) $Button2 = GUICtrlCreateButton("Button2", 0, 24, 75, 25, $WS_GROUP) $Button3 = GUICtrlCreateButton("mouse trap", 0, 48, 75, 25, $WS_GROUP) $Button4 = GUICtrlCreateButton("unknown4", 0, 72, 75, 25, $WS_GROUP) $Button5 = GUICtrlCreateButton("unknown5", 0, 96, 75, 25, $WS_GROUP) $Button6 = GUICtrlCreateButton("itunes", 0, 120, 75, 25, $WS_GROUP) $Button7 = GUICtrlCreateButton("itunes pause", 0, 144, 75, 25, $WS_GROUP) $Button8 = GUICtrlCreateButton("next song*", 0, 168, 75, 25, $WS_GROUP) $Button9 = GUICtrlCreateButton("unknown9", 0, 192, 75, 25, $WS_GROUP) $Button10 = GUICtrlCreateButton("unknown10", 0, 216, 75, 25, $WS_GROUP) $Button11 = GUICtrlCreateButton("unknown11", 0, 240, 75, 25, $WS_GROUP) $Button12 = GUICtrlCreateButton("unknown12", 0, 264, 75, 35, $WS_GROUP) ;++++row 2++++150 $Button21 = GUICtrlCreateButton("unknown21",75, 0, 75, 25, $WS_GROUP) $Button22 = GUICtrlCreateButton("unknown22",75, 24, 75, 25, $WS_GROUP) $Button23 = GUICtrlCreateButton("unknown23",75, 48, 75, 25, $WS_GROUP) $Button24 = GUICtrlCreateButton("unknown24",75, 72, 75, 25, $WS_GROUP) $Button25 = GUICtrlCreateButton("unknown25",75, 96, 75, 25, $WS_GROUP) $Button26 = GUICtrlCreateButton("unknown26",75, 120, 75, 25, $WS_GROUP) $Button27 = GUICtrlCreateButton("unknown27",75, 144, 75, 25, $WS_GROUP) $Button28 = GUICtrlCreateButton("firefox",75, 168, 75, 25, $WS_GROUP) $Button29 = GUICtrlCreateButton("unknown29",75, 192, 75, 25, $WS_GROUP) $Button30 = GUICtrlCreateButton("unknown30",75, 216, 75, 25, $WS_GROUP) $Button31 = GUICtrlCreateButton("notepad",75, 240, 75, 25, $WS_GROUP) $Button32 = GUICtrlCreateButton("restart",75, 264, 75, 35, $WS_GROUP) ;============================== buttons end ============================================== ;test1 ;end test 1 ;check box 1 $checkbox1 = GUICtrlCreateCheckbox("Check Button1", 260, 10, 120, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ;==============================--case--======================================================= while 2 Sleep(10) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit ;+++ROW 1++++ (1-12) Case $Button1 _Login1() Case $Button2 _Login2() Case $Button3 _Login3() Case $Button4 _Login4() Case $Button5 _Login5() Case $Button6 _Login6() Case $Button7 _Login7() Case $Button8 _Login8() Case $Button9 _Login9() Case $Button10 _Login10() Case $Button11 _Login11() Case $Button12 _Login12() ;+++ROW 2++++ (21-32) Case $Button21 _Login21() Case $Button22 _Login22() Case $Button23 _Login23() Case $Button24 _Login24() Case $Button25 _Login25() Case $Button26 _Login26() Case $Button27 _Login27() Case $Button28 _Login28() Case $Button29 _Login29() Case $Button30 _Login30() Case $Button31 _Login31() Case $Button32 _Login32() ;+++++++++++++++row 3 case GUICtrlSetState($checkbox1, $GUI_UNCHECKED) _loginchecked() case GUICtrlSetState($checkbox1, $GUI_CHECKED) _loginunchecked() case $pauseitem case $exititem EndSwitch WEnd ;==========================================--caseend--====================================== ;=============================================-LOGINS-============================= Func _Login1() exit EndFunc Func _Login2() EndFunc Func _Login3() ;this was just for fun Opt("MustDeclareVars", 1) Local $GUI, $coords[4] GUISetState() While 1 $coords = WinGetPos($GUI) _MouseTrap($coords[0], $coords[1], $coords[0] + $coords[2], $coords[1] + $coords[3]) Switch GUIGetMsg() Case $GUI_EVENT_CLOSE exit case $button1 exit case $button21 Case Else ;;; EndSwitch WEnd _MouseTrap() exit EndFunc ;==>_Main Func _Login4() EndFunc func _Login5() EndFunc FUNC _login6() ;runs itunes Send("#r") WinWaitActive("Run") Send("C:\Users\Public\Desktop\iTunes.lnk{Enter}") WinSetState("itunes", "",@SW_SHOWMINIMIZED ) EndFunc Func _login7() ;pause/play WinActivate("iTunes","") Send("{MEDIA_PLAY_PAUSE}") WinSetState("iTunes", "",@SW_MINIMIZE) WinSetState("Bryce's", "",@SW_MINIMIZE) EndFunc Func _login8() ;next song WinActivate("iTunes","") Send("{MEDIA_NEXT}") WinSetState("iTunes", "",@SW_MINIMIZE) WinSetState("Bryce's", "",@SW_MINIMIZE) EndFunc Func _login9() EndFunc Func _login10() EndFunc Func _login11() EndFunc Func _login12() EndFunc ;+++++++++++++++++ row 2 Func _login21() EndFunc Func _login22() EndFunc Func _login23() EndFunc Func _login24() EndFunc Func _login25() EndFunc Func _login26() EndFunc Func _login27() EndFunc Func _login28() Send("#r") WinWaitActive("Run") Send("C:\Users\Public\Desktop\Mozilla Firefox.lnk{Enter}") EndFunc Func _login29() EndFunc Func _login30() EndFunc Func _login31() Run(@WindowsDir & "\Notepad.exe", "", @SW_MINIMIZE) EndFunc Func _login32() BlockInput(0) Send("#r") WinWaitActive("Run") Send("C:\Users\Bryce\Desktop\gui2.au3{Enter}") BlockInput(1) exit EndFunc ;==================================-END LOGINS-======================================= Link to comment Share on other sites More sharing options...
Abryce Posted August 9, 2010 Author Share Posted August 9, 2010 also is there a way to stop this for endless looping i like to have do that the button and when i press it i just want to add have that button show iTunes and then re-minimize. HotKeySet("{MEDIA_PLAY_PAUSE}", "up") HotKeySet("{MEDIA_NEXT}", "right") HotKeySet("{MEDIA_PREV}", "left") func right() WinActivate("iTunes","") sleep(100) Send("{MEDIA_NEXT}") WinSetState("iTunes", "",@SW_MINIMIZE) ;WinSetState("Bryce's", "",@SW_MINIMIZE) endfunc func left() WinActivate("iTunes","") sleep(100) Send("{MEDIA_PREV}") WinSetState("iTunes", "",@SW_MINIMIZE) ;WinSetState("Bryce's", "",@SW_MINIMIZE) endfunc func up() WinActivate("iTunes","") sleep(100) Send("{MEDIA_PLAY_PAUSE}") WinSetState("iTunes", "",@SW_MINIMIZE) ;WinSetState("Bryce's", "",@SW_MINIMIZE) endfunc also if you can help me on the 1st part or tell me its impossible its fine, i know most of the songs anyways. oh and alittle side note is there any fourm rules besides swearing and game bots, if so message the link with all the fourm rules. thanks ~bryce Link to comment Share on other sites More sharing options...
jaberwacky Posted August 9, 2010 Share Posted August 9, 2010 (edited) $iTunesApp = ObjCreate("iTunes.Application") $iTunesApp.PlayPause ToolTip($iTunesApp.CurrentTrack.name) Sleep(5000)I got that from the iTunes UDF.Swearing should be kept at a minumum because there are some teenaged people here. Game bots are a no-no. Valik has posted a sticky at the top of the General Help forum. AutoIt cannot be used for anything that violates any TOS or any EULA. It's all here in the forums. Edited August 9, 2010 by jaberwocky6669 Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Abryce Posted August 9, 2010 Author Share Posted August 9, 2010 that helps alot, and the Itunes UDF helps with the 2nd post how do u have the ToolTip update like if i press next on a song to switch $iTunesApp = ObjCreate("iTunes.Application") ToolTip($iTunesApp.CurrentTrack.name,0,0) Sleep(5000) songs i took out the "$iTunesApp.PlayPause" due to it pauses/plays itunes every time i run the script. Link to comment Share on other sites More sharing options...
jaberwacky Posted August 9, 2010 Share Posted August 9, 2010 (edited) Use functions: expandcollapse popup#include <Misc.au3> _Singleton(@ScriptName) $iTunesApp = ObjCreate("iTunes.Application") WinWaitActive("iTunes") HotKeySet("{PGUP}", "NextTrack") HotKeySet("{PGDN}", "PrevTrack") HotKeySet("{PAUSE}", "PlayPause") While 1 Sleep(100) WEnd Func PlayPause() WinWaitActive("iTunes") $iTunesApp.PlayPause WinWaitActive("iTunes") DispCurrent() EndFunc ;==>PlayPause Func NextTrack() WinWaitActive("iTunes") $iTunesApp.NextTrack WinWaitActive("iTunes") DispCurrent() EndFunc ;==>NextTrack Func PrevTrack() WinWaitActive("iTunes") $iTunesApp.PreviousTrack WinWaitActive("iTunes") DispCurrent() EndFunc ;==>PrevTrack Func DispCurrent() Local Const $currentTrack = $iTunesApp.CurrentTrack.name ToolTip($currentTrack) Sleep(3000) ToolTip("") EndFunc ;==>DispCurrent Edited August 9, 2010 by jaberwocky6669 Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Abryce Posted August 9, 2010 Author Share Posted August 9, 2010 thank you so much this is how i have my hotkeys set up expandcollapse popupGlobal $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("{F7}", "hide2") HotKeySet("{F8}", "show2") HotKeySet("{F11}", "top") HotKeySet("{F12}", "notop") HotKeySet("{Home}", "bring") HotKeySet("{END}", "away") HotKeySet("{MEDIA_PLAY_PAUSE}", "up") HotKeySet("{MEDIA_NEXT}", "right") HotKeySet("{MEDIA_PREV}", "left") HotKeySet("{LAUNCH_MAIL}", "song1") ;000000000000000000000 hotkeys 00000000000000 Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc ;hides gui bryce Func Hide2() WinSetState("Bryce's", "", @SW_HIDE) #NoTrayIcon EndFunc ;shows gui bryce func show2() WinSetState("Bryce's", "", @SW_SHOW) TraySetState (1) endfunc func top() WinSetState("Bryce's", "", @SW_RESTORE ) endfunc ;set no top func notop() WinSetState("Bryce's", "", @SW_MINIMIZE ) endfunc func bring() WinActivate("Bryce's","") endfunc ;itunes pause/play func away() WinSetState("Bryce's", "",@SW_MINIMIZE) endfunc func right() _iTunes_Next() endfunc func left() _iTunes_Prev() endfunc func up() _iTunes_Play_Pause() endfunc func song1() $iTunesApp = ObjCreate("iTunes.Application") $currentTrack = $iTunesApp.CurrentTrack.name ToolTip($currentTrack,0,0) Sleep(3000) ToolTip("") endfunc if i press LAUNCH_MAIL it will show the current song i had it at f4 but i have a laptop and i would be pressing fn then F4 so i changed it to launch mail since i use yahoo anyways thanks again for helping me Link to comment Share on other sites More sharing options...
jaberwacky Posted August 10, 2010 Share Posted August 10, 2010 (edited) No problem. That example was just meant to get you started anyways. There is still the problem of displaying the song with a tooltip when iTunes changes the song as opposed to when you change the song via hotkey. Also, I had problems using my media keys as hotkeys but it works out for you? Edited August 10, 2010 by jaberwocky6669 Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Abryce Posted August 10, 2010 Author Share Posted August 10, 2010 (edited) yea it works out good, but some times i get an error, i think its becuz i have to open itunes with the script here is mine so far its been working out really good - the error i get sometimes thanks again. expandcollapse popup#cs -------------------------------------notes-------------------------- #ce #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> #include <GuiConstantsEx.au3> #include <Misc.au3> #include <iTunes.au3> ;test1 #NoTrayIcon _Singleton(@ScriptName) ;================================= itemtray =================================================== Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown. $pauseitem =TrayCreateItem("pause") $exititem = TrayCreateItem("Exit") TraySetToolTip("Bryce") TraySetIcon("Shell32.dll",48) TraySetState() ; Show the tray icon ;============================== itemtray ========================================== ;================================= hotkeys ====================================== Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("{F7}", "hide2") HotKeySet("{F8}", "show2") HotKeySet("{F11}", "top") HotKeySet("{F12}", "notop") HotKeySet("{Home}", "bring") HotKeySet("{END}", "away") HotKeySet("{MEDIA_PLAY_PAUSE}", "up") HotKeySet("{MEDIA_NEXT}", "right") HotKeySet("{MEDIA_PREV}", "left") HotKeySet("{LAUNCH_MAIL}", "song1") HotKeySet("{LAUNCH_APP2}", "test32") HotKeySet("{F3}", "starttunes") HotKeySet("{DEL}", "test30") ;__________________itunes______________ #cs Func _login8() WinActivate("iTunes","") Send("{MEDIA_NEXT}") WinActivate("Bryce's","") EndFunc #ce ;_____________________________________ ;000000000000000000000 hotkeys 00000000000000 Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc ;hides gui bryce Func Hide2() WinSetState("Bryce's", "", @SW_HIDE) #NoTrayIcon EndFunc ;shows gui bryce func show2() WinSetState("Bryce's", "", @SW_SHOW) TraySetState (1) endfunc ;set top func top() WinSetState("Bryce's", "", @SW_RESTORE ) endfunc ;set no top func notop() WinSetState("Bryce's", "", @SW_MINIMIZE ) endfunc func bring() WinSetState("iTunes", "", @SW_SHOW) endfunc ;itunes pause/play func away() WinSetState("iTunes", "", @SW_HIDE) endfunc func right() _iTunes_Next() endfunc func left() _iTunes_Prev() endfunc func up() _iTunes_Play_Pause() endfunc func song1() $iTunesApp = ObjCreate("iTunes.Application") $currentTrack = $iTunesApp.CurrentTrack.name $currentartist = $itunesApp.CurrentTrack.artist ToolTip("iTunes:" & $currentTrack & ", By: " & $currentartist,0,0) Sleep(3000) ToolTip("") endfunc func test32() WinSetState("Bryce's", "", @SW_HIDE) endfunc func starttunes() _iTunes_Start() ;starts itunes F3 endfunc func test30() Send("#r") WinWaitActive("Run") Send("C:\Users\Bryce\Desktop\gui2.au3{Enter}") exit ;restarts "bryce" script:button "delete" endfunc ;000000000000000000000 hotkeys END 00000000000000 ;================================= hotkeys END ====================================== _iTunes_Start() ;stops the error i got. ;============================= #cs $toggle = 0 While 1 $msg = TrayGetMsg() Select Case $msg = 0 Sleep(1000) If $toggle = 0 Then TraySetState() ; Show the tray icon $toggle = 1 Else TraySetState(2) ; Hide the tray icon $toggle = 0 EndIF Case $msg = $exititem ExitLoop EndSelect wend #ce ;test end ;============================== buttons ============================================== #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("Bryce's", 400, 320) $mFileMenu = GUICtrlCreateMenu("&File") ;++++row 1++++++ $Button1 = GUICtrlCreateButton("exit", 0, 0, 75, 25, $WS_GROUP) $Button2 = GUICtrlCreateButton("Button2", 0, 24, 75, 25, $WS_GROUP) $Button3 = GUICtrlCreateButton("mouse trap", 0, 48, 75, 25, $WS_GROUP) $Button4 = GUICtrlCreateButton("unknown4", 0, 72, 75, 25, $WS_GROUP) $Button5 = GUICtrlCreateButton("unknown5", 0, 96, 75, 25, $WS_GROUP) $Button6 = GUICtrlCreateButton("itunes", 0, 120, 75, 25, $WS_GROUP) $Button7 = GUICtrlCreateButton("itunes pause", 0, 144, 75, 25, $WS_GROUP) $Button8 = GUICtrlCreateButton("next song*", 0, 168, 75, 25, $WS_GROUP) $Button9 = GUICtrlCreateButton("unknown9", 0, 192, 75, 25, $WS_GROUP) $Button10 = GUICtrlCreateButton("unknown10", 0, 216, 75, 25, $WS_GROUP) $Button11 = GUICtrlCreateButton("unknown11", 0, 240, 75, 25, $WS_GROUP) $Button12 = GUICtrlCreateButton("unknown12", 0, 264, 75, 35, $WS_GROUP) ;++++row 2++++150 $Button21 = GUICtrlCreateButton("unknown21",75, 0, 75, 25, $WS_GROUP) $Button22 = GUICtrlCreateButton("unknown22",75, 24, 75, 25, $WS_GROUP) $Button23 = GUICtrlCreateButton("unknown23",75, 48, 75, 25, $WS_GROUP) $Button24 = GUICtrlCreateButton("unknown24",75, 72, 75, 25, $WS_GROUP) $Button25 = GUICtrlCreateButton("unknown25",75, 96, 75, 25, $WS_GROUP) $Button26 = GUICtrlCreateButton("unknown26",75, 120, 75, 25, $WS_GROUP) $Button27 = GUICtrlCreateButton("unknown27",75, 144, 75, 25, $WS_GROUP) $Button28 = GUICtrlCreateButton("firefox",75, 168, 75, 25, $WS_GROUP) $Button29 = GUICtrlCreateButton("unknown29",75, 192, 75, 25, $WS_GROUP) $Button30 = GUICtrlCreateButton("unknown30",75, 216, 75, 25, $WS_GROUP) $Button31 = GUICtrlCreateButton("notepad",75, 240, 75, 25, $WS_GROUP) $Button32 = GUICtrlCreateButton("restart",75, 264, 75, 35, $WS_GROUP) ;============================== buttons end ============================================== ;test1 ;end test 1 ;check box 1 $checkbox1 = GUICtrlCreateCheckbox("Check Button1", 260, 10, 120, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ;==============================--case--======================================================= while 2 Sleep(10) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit ;+++ROW 1++++ (1-12) Case $Button1 _Login1() Case $Button2 _Login2() Case $Button3 _Login3() Case $Button4 _Login4() Case $Button5 _Login5() Case $Button6 _Login6() Case $Button7 _Login7() Case $Button8 _Login8() Case $Button9 _Login9() Case $Button10 _Login10() Case $Button11 _Login11() Case $Button12 _Login12() ;+++ROW 2++++ (21-32) Case $Button21 _Login21() Case $Button22 _Login22() Case $Button23 _Login23() Case $Button24 _Login24() Case $Button25 _Login25() Case $Button26 _Login26() Case $Button27 _Login27() Case $Button28 _Login28() Case $Button29 _Login29() Case $Button30 _Login30() Case $Button31 _Login31() Case $Button32 _Login32() ;+++++++++++++++row 3 case GUICtrlSetState($checkbox1, $GUI_UNCHECKED) _loginchecked() case GUICtrlSetState($checkbox1, $GUI_CHECKED) _loginunchecked() case $pauseitem case $exititem EndSwitch WEnd ;==========================================--caseend--====================================== ;=============================================-LOGINS-============================= Func _Login1() exit EndFunc Func _Login2() EndFunc Func _Login3() ;this was just for fun Opt("MustDeclareVars", 1) Local $GUI, $coords[4] GUISetState() While 1 $coords = WinGetPos($GUI) _MouseTrap($coords[0], $coords[1], $coords[0] + $coords[2], $coords[1] + $coords[3]) Switch GUIGetMsg() Case $GUI_EVENT_CLOSE exit case $button1 exit case $button21 Case Else ;;; EndSwitch WEnd _MouseTrap() exit EndFunc ;==>_Main Func _Login4() EndFunc func _Login5() EndFunc FUNC _login6() ;runs itunes _iTunes_Start() WinSetState("itunes", "",@SW_SHOWMINIMIZED ) EndFunc Func _login7() ;pause/play WinActivate("iTunes","") Send("{MEDIA_PLAY_PAUSE}") WinSetState("iTunes", "",@SW_MINIMIZE) WinSetState("Bryce's", "",@SW_MINIMIZE) EndFunc Func _login8() ;next song WinActivate("iTunes","") Send("{MEDIA_NEXT}") WinSetState("iTunes", "",@SW_MINIMIZE) WinSetState("Bryce's", "",@SW_MINIMIZE) EndFunc Func _login9() EndFunc Func _login10() EndFunc Func _login11() EndFunc Func _login12() EndFunc ;+++++++++++++++++ row 2 Func _login21() EndFunc Func _login22() EndFunc Func _login23() EndFunc Func _login24() EndFunc Func _login25() EndFunc Func _login26() EndFunc Func _login27() EndFunc Func _login28() Send("#r") WinWaitActive("Run") Send("C:\Users\Public\Desktop\Mozilla Firefox.lnk{Enter}") EndFunc Func _login29() EndFunc Func _login30() EndFunc Func _login31() Run(@WindowsDir & "\Notepad.exe", "", @SW_MINIMIZE) EndFunc Func _login32() BlockInput(0) Send("#r") WinWaitActive("Run") Send("C:\Users\Bryce\Desktop\gui2.au3{Enter}") BlockInput(1) exit EndFunc #cs Func _login() EndFunc Func _login() EndFunc #CE func _loginchecked() while 1 Msgbox(266240,"checked","box is checked") wend EndFunc func _loginunchecked() endfunc ;==================================-END LOGINS-======================================= #cs ========================================== test area ========================== Global $Button** $Button1 $Button2 $Button3 $Button4 $Button5 $Button6 $Button7 $Button8 $Button9 $Button10 $Button11 $Button12 $Button13 $Button14 $Button15 $Button16 $Button17 $Button18 $Button19 $Button20 $Button21 $Button22 $Button23 $Button24 $Button25 $Button26 $Button27 $Button28 $Button29 $Button30 $Button31 $Button32 $Button33 $Button34 $Button35 $Button36 $Button37 $Button38 $Button39 $Button40 $Button41 $Button42 $Button43 $Button44 $Button45 $Button46 $Button47 $Button48 $Button49 $Button50 #ce i might try to have it running every time i start itune but its good where it is now. its fun just playing with it alittle bit at a time. edit: i think iv fixed those error iv gotten ;================================= hotkeys END ====================================== _iTunes_Start() ;stops the error i got. when my script starts itunes will start if it hasnt but if it has allready started i think it attaches it self to itune or something where it will use the iTunes UDF's it hasnt failed yet Edited August 11, 2010 by abryce17 Link to comment Share on other sites More sharing options...
Abryce Posted August 11, 2010 Author Share Posted August 11, 2010 (edited) okay i was working on this and now i kinda give up it and am asking for help. HotKeySet("{F4}", "test32") func test32() $iTunesApp = ObjCreate("iTunes.Application") $currentTrack = $iTunesApp.CurrentTrack.name $currentartist = $itunesApp.CurrentTrack.artist $nextsong = $iTunesApp.CurrentTrack.Time * 77000 ToolTip("iTunes:" & $currentTrack & ", By: " & $currentartist,150,0) Sleep($nextsong) ToolTip("") sleep(500) ToolTip("iTunes:" & $currentTrack & ", By: " & $currentartist,150,0) Sleep($nextsong) ToolTip("") endfunc im trying to get it to change with the song, the tooltip ends after the next song starts but it still shows the 1st song i think the song has to be at least 1 min. thats what iv tested it on. im trying to get the tooltip to show all the time, or at least when the song ends and another song starts maybe a good night sleep is what i need lol Edited August 11, 2010 by abryce17 Link to comment Share on other sites More sharing options...
Abryce Posted August 13, 2010 Author Share Posted August 13, 2010 i found out the time problem but when it changes songs it still says the first song that was playing heres what the func is now func test32() $iTunesApp = ObjCreate("iTunes.Application") $currentTrack = $iTunesApp.CurrentTrack.name $currentartist = $itunesApp.CurrentTrack.artist $nextsong = $iTunesApp.CurrentTrack.duration * 1000 +2000 ToolTip("iTunes:" & $currentTrack & ", By: " & $currentartist,150,0) Sleep($nextsong) sleep(1000) ToolTip("") ToolTip("iTunes:" & $currentTrack & ", By: " & $currentartist,150,0) Sleep($nextsong) ToolTip("") #cs send($nextsong) this was for me to get the song time nailed down #ce endfunc Link to comment Share on other sites More sharing options...
jaberwacky Posted August 13, 2010 Share Posted August 13, 2010 (edited) I've been fiddlin' 'round with this and with the grand help of Richard Robertson without whom I would not be standing up here today. Now, anytime that iTunes does something you can make AutoIt do something in response... expandcollapse popup#region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_AU3Check_Stop_OnWarning=y #AutoIt3Wrapper_AU3Check_Parameters=-w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -d #AutoIt3Wrapper_Run_Tidy=y #endregion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <IE.au3> OnAutoItExitRegister("_Exit") HotKeySet("{ESC}", "term") _IEErrorHandlerRegister() Global $iTunesApp = ObjCreate("iTunes.Application") ObjEvent($iTunesApp, "iTunesEvent_", "_IiTunesEvents") $iTunesApp.Play Sleep(3000) $iTunesApp.SoundVolume = 70 Sleep(3000) $iTunesApp.SoundVolume = 30 Sleep(3000) $iTunesApp.NextTrack Sleep(3000) Func term() ConsoleWrite('@@ (36) :(' & @MIN & ':' & @SEC & ') term()' & @CR) ;### Function Trace Exit EndFunc ;==>term Func _exit() ConsoleWrite('@@ (41) :(' & @MIN & ':' & @SEC & ') _exit()' & @CR) ;### Function Trace $iTunesApp.Quit EndFunc ;==>_exit Func iTunesEvent_OnSoundVolumeChangedEvent($newVolume) ConsoleWrite('@@ (46) :(' & @MIN & ':' & @SEC & ') iTunesEvent_OnSoundVolumeChangedEvent()' & @CR) ;### Function Trace ConsoleWrite("Volume: " & $newVolume & @LF) EndFunc ;==>iTunesEvent_OnSoundVolumeChangedEvent Func iTunesEvent_OnPlayerPlayEvent() ConsoleWrite('@@ (51) :(' & @MIN & ':' & @SEC & ') iTunesEvent_OnPlayerPlayEvent()' & @CR) ;### Function Trace ConsoleWrite($iTunesApp.CurrentTrack.name & @LF) EndFunc ;==>iTunesEvent_OnPlayerPlayEvent Func iTunesEvent_onQuittingEvent() ConsoleWrite('@@ (56) :(' & @MIN & ':' & @SEC & ') iTunesEvent_onQuittingEvent()' & @CR) ;### Function Trace iTunesQuit() EndFunc ;==>iTunesEvent_onQuittingEvent Func iTunesEvent_onPlayerStopEvent() ConsoleWrite('@@ (61) :(' & @MIN & ':' & @SEC & ') onPlayerStopEvent()' & @CR) ;### Function Trace ConsoleWrite($iTunesApp.CurrentTrack.name & @LF) EndFunc ;==>iTunesEvent_onPlayerStopEvent Func iTunesQuit() ConsoleWrite('@@ (66) :(' & @MIN & ':' & @SEC & ') iTunesQuit()' & @CR) ;### Function Trace $iTunesApp = '' Exit EndFunc ;==>iTunesQuit Ok well, it ain't all that much, but seein' as to how I'm just a simple country bumpkin hayseed, I'm enthralled. Edited August 14, 2010 by jaberwocky6669 Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? 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