heyhey Posted February 2, 2011 Posted February 2, 2011 (edited) HotKeySet("!k","openmsn") HotKeySet("!t","stopitunes") While 1 Sleep(100) WEnd Func openmsn() WinActivate ("Windows Live Messenger") EndFunc Func stopitunes() $title=WinGetTitle("[active]") WinActivate("iTunes") Send("{SPACE}") Sleep(100) WinActivate("$title") If WinActive("$title") Then MsgBox(0,"","Window is active again") EndIf EndFunc I'm attempting to make a script myself that opens itunes, pauses itunes (with spacebar) and then goes back to the previous window. Everything works but it won't go back to the previous window. If you don't understand how I attempted to do this , this was my plan: 1. Saving the current active window using $tile=WinGetTitle("[Active]") 2. Activate itunes, pause iTunes. 3. Activate the previous active window using $title again Does anybody know what I did wrong? Thank you. Edited February 2, 2011 by heyhey
JohnOne Posted February 2, 2011 Posted February 2, 2011 WinActivate("$title") = WinActivate($title) You dont need quotes with a variable. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Moderators Melba23 Posted February 2, 2011 Moderators Posted February 2, 2011 heyhey, You do not need quotes ("") around variables - just use: WinActivate($title) If WinActive($title) M23 P.S. How is the function interrupt code comimg along? 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
heyhey Posted February 2, 2011 Author Posted February 2, 2011 (edited) Thanks, RE:P.S : The function interrupt code is not in this script, but thank you for making that tutorial, I might even consider using it in this script also, but only when I have more functions than just itunes pause and openmsn EDIT: Does anyone know how to do this when watching youtube fullscreen? Like it goes back to fullscreen, just wondering if that is possible? Edited February 2, 2011 by heyhey
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