ConsultingJoe Posted October 27, 2007 Posted October 27, 2007 (edited) I made this because I needed the hotkeys to be global and this way I can run pandora without running firefox/IE.Script Access is also off to disallow popups (I liked that this worked, but you can't get to outside links from it)EnjoyHotkeys{Media_Next} - Next Song{Media_Play_Pause} - Play/Pause{F2} - Like It{F3} - Hate Itexpandcollapse popup#include <GUIConstants.au3> #Include <Constants.au3> #NoTrayIcon Opt("TrayMenuMode",1) Opt("TrayOnEventMode",1) Opt("GUIEventOptions",1) Opt("GUIOnEventMode", 1) $Form1 = GUICreate("Pandora/Autoit Mashup", 640, 270) $menu = GUICtrlCreateMenuItem( "Open Pandora In Browser", -1 ) GUICtrlSetOnEvent( -1, "openpandora" ) $pandora = ObjCreate ("ShockwaveFlash.ShockwaveFlash.1") $pandorawin = GUICtrlCreateObj($pandora, 0, 0, 640, 250) With $pandora .bgcolor = "#FFFFFF" .Movie = 'https://www.pandora.com:443/radio/tuner_8_2_0_0_pandora_mini.swf' .ScaleMode = 2 .Loop = True .wmode = "Window" .allowScriptAccess = "Never";NO POPUPS .FlashVars = "_tunervar_shost=www.pandora.com&_tunervar_skin=pandora&_tunervar_zone=prod&_tunervar_width=640&_tunervar_amazonurl=http%3A%2F%2Fwww.amazon.com%2Fexec%2Fobidos%2Fredirect%3Ftag%3Dsavagebeast-20&_tunervar_height=522&_tunervar_host=www.pandora.com&_tunervar_ar=0&_tunervar_port=80&_tunervar_sport=443&_tunervar_itunesurl=http%3A%2F%2Fclick.linksynergy.com%2Ffs-bin%2Fstat%3Fid%3DFLenzF8lvbI%26offerid%3D78941%26type%3D3%26subid%3D0%26tmpid%3D1826" EndWith _GuiRoundCorners($Form1, 0, 0, 20, 20) WinSetTrans( $Form1, "", 0 ) GUISetState(@SW_SHOW) For $i = 0 To 255 Step 10 WinSetTrans( $Form1, "", $i ) Sleep(20) Next GUISetOnEvent($GUI_EVENT_CLOSE, "quit") GUISetOnEvent($GUI_EVENT_MINIMIZE, "min") TraySetOnEvent($TRAY_EVENT_PRIMARYDOWN,"trayminmax") TraySetClick ( 8 ) $settingsitem = TrayCreateItem("Goto Pandora") TrayItemSetOnEvent(-1, "openpandora") $exititem = TrayCreateItem("Exit") TrayItemSetOnEvent(-1, "quit") TraySetState() HotKeySet( "{MEDIA_NEXT}", "nextsong" ) HotKeySet( "{MEDIA_PLAY_PAUSE}", "play" ) HotKeySet( "{F2}", "like" ) HotKeySet( "{F3}", "hate" ) AdlibEnable( "active", 500 ) While 1 Sleep(10) WEnd Func like() If WinActive( $Form1 ) Then Return ControlSend($Form1, "", "MacromediaFlashPlayerActiveX1", "=") EndFunc Func hate() If WinActive( $Form1 ) Then Return ControlSend($Form1, "", "MacromediaFlashPlayerActiveX1", "-") EndFunc Func nextsong() If WinActive( $Form1 ) Then Return Sleep(500) ControlSend($Form1, "", "MacromediaFlashPlayerActiveX1", "{right}") EndFunc Func play() If WinActive( $Form1 ) Then Return Sleep(500) ControlSend($Form1, "", "MacromediaFlashPlayerActiveX1", "{space}") EndFunc Func openpandora() Run(@ComSpec & " /c " & 'start http://www.pandora.com/', "", @SW_HIDE) EndFunc Func quit() If WinGetState( $Form1 ) <> @SW_HIDE Then For $i = 255 To 0 Step -15 WinSetTrans( $Form1, "", $i ) Next EndIf Exit EndFunc Func min() For $i = 255 To 25 Step -20 WinSetTrans( $Form1, "", $i ) Sleep(15) Next WinSetState( $Form1, "", @SW_HIDE ) AdlibDisable() EndFunc Func trayminmax() If WinGetState( $Form1 ) = 5 Then WinSetState( $Form1, "", @SW_SHOW ) WinActivate( $Form1 ) For $i = 25 To 255 Step 20 WinSetTrans( $Form1, "", $i ) Sleep(15) Next AdlibEnable( "active", 500 ) Else For $i = 255 To 25 Step -20 WinSetTrans( $Form1, "", $i ) Sleep(15) Next WinSetState( $Form1, "", @SW_HIDE ) AdlibDisable() EndIf Return EndFunc Func active() ControlFocus($Form1, "", "MacromediaFlashPlayerActiveX1") EndFunc Func _GuiRoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3) Dim $pos, $ret, $ret2 $pos = WinGetPos($h_win) $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $pos[2], "long", $pos[3], "long", $i_x3, "long", $i_y3) If $ret[0] Then $ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $ret[0], "int", 1) If $ret2[0] Then Return 1 Else Return 0 EndIf Else Return 0 EndIf EndFunc ;==>_GuiRoundCorners Edited November 8, 2007 by CyberZeroCool Check out ConsultingJoe.com
HeffeD Posted October 28, 2007 Posted October 28, 2007 I get a couple errors when I start it up, but it does eventually work. Well, same error, but twice. The Procedure entry point GetProcessImageFileNameW could not be located in the dynamic link library PSAPI.DLL. It shows me that twice before opening. I wish that clicking on one of the song title/band name/album title links would open that page in the web browser, but perhaps it's supposed to do that and the error message that I get is breaking that functionality?
ConsultingJoe Posted October 29, 2007 Author Posted October 29, 2007 I get a couple errors when I start it up, but it does eventually work. Well, same error, but twice. The Procedure entry point GetProcessImageFileNameW could not be located in the dynamic link library PSAPI.DLL. It shows me that twice before opening. I wish that clicking on one of the song title/band name/album title links would open that page in the web browser, but perhaps it's supposed to do that and the error message that I get is breaking that functionality?I had that same problem. the error isn't from my script its because of that dll. I think it was from an update (Autoit/Flash). To Solve: Delete/Rename the the dll (C:\Program Files\AutoIt3\psapi.dll). Its already in the system32 folder. To allow the popups just change .allowScriptAccess = "Never";NO POPUPSoÝ÷ Ù3ºÚ"µÍ[ÝÔØÜXØÙÜÈH ][ÝÐ[Ø^É][ÝÎÐSÕÈÔT Check out ConsultingJoe.com
HeffeD Posted October 29, 2007 Posted October 29, 2007 Ah, OK. Renaming the .dll to .bak fixed the original error message, but allowing popups gives more errors. I get three or four "Internet Explorer can not download . Unspecified Error" messages... As a Firefox user, I'm not sure what these things that IE is trying to download are, and as you can see the error message isn't helpful. Does IE ordinarily have popup windows on Pandora? All I'd like to have is the ability to click the links and be able to edit the station. Not a real big deal though. I can still open Pandora in my browser if I want to edit the station. I'm running Windows Media Center SP2 and it has IE7 if that makes any difference. Other than that, nice job! I like this method much better than using a browser.
ConsultingJoe Posted October 29, 2007 Author Posted October 29, 2007 Ah, OK. Renaming the .dll to .bak fixed the original error message, but allowing popups gives more errors. I get three or four "Internet Explorer can not download . Unspecified Error" messages...As a Firefox user, I'm not sure what these things that IE is trying to download are, and as you can see the error message isn't helpful. Does IE ordinarily have popup windows on Pandora? All I'd like to have is the ability to click the links and be able to edit the station. Not a real big deal though. I can still open Pandora in my browser if I want to edit the station. I'm running Windows Media Center SP2 and it has IE7 if that makes any difference.Other than that, nice job! I like this method much better than using a browser.Thanks, Yeah, I don't know why the popups come up with the errors when you change that. But check the 1st post for an update:Repaired hotkey rekeyAdded menu linking the browser view Check out ConsultingJoe.com
HeffeD Posted October 29, 2007 Posted October 29, 2007 Nice, thanks! This has become my most used script.
WeMartiansAreFriendly Posted October 29, 2007 Posted October 29, 2007 Good job, CyberZeroCool. I like it Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet()
ConsultingJoe Posted October 29, 2007 Author Posted October 29, 2007 Thanks guys Check out ConsultingJoe.com
HeffeD Posted November 7, 2007 Posted November 7, 2007 Is this broken now? I just tried to fire it up tonight and it doesn't load. When opening Pandora in my browser, it looks like they've made some changes to the layout. I guess the changes aren't compatible with the script?
ConsultingJoe Posted November 7, 2007 Author Posted November 7, 2007 Updated to Pandora's new version. Check out ConsultingJoe.com
ConsultingJoe Posted November 7, 2007 Author Posted November 7, 2007 (edited) NP, I'd like to add to this, There is a way to pull the song and artist from this. Anyone have any ideas of things to add? Edited November 7, 2007 by CyberZeroCool Check out ConsultingJoe.com
Armeggadon Posted November 7, 2007 Posted November 7, 2007 Love the script, have been looking for a way to do this without always opening firefox and forgetting the pandora tab is open when i close it. The only addition I would like to see would be a "minimize to a tray icon" button or option, so you can open it and just leave it running in the background without taking up taskbar space, and then on top of that maybe options so that you can click the tray icon and get a menu with the play/pause, next, etc. options
ConsultingJoe Posted November 7, 2007 Author Posted November 7, 2007 Love the script, have been looking for a way to do this without always opening firefox and forgetting the pandora tab is open when i close it.The only addition I would like to see would be a "minimize to a tray icon" button or option, so you can open it and just leave it running in the background without taking up taskbar space, and then on top of that maybe options so that you can click the tray icon and get a menu with the play/pause, next, etc. optionsSure, Great idea, I would love to do that. I will try to do it tonight. Check out ConsultingJoe.com
ConsultingJoe Posted November 8, 2007 Author Posted November 8, 2007 Updated, check first post. Check out ConsultingJoe.com
HeffeD Posted November 13, 2007 Posted November 13, 2007 It does everything I'd like it to do at the moment, but I think anything else you want to add could only make a good thing better!
frostfel Posted November 21, 2007 Posted November 21, 2007 This is leet. Ive been tryin to figure out how to do that hotkeys thxs for postin
MePHiTiC Posted November 27, 2007 Posted November 27, 2007 This script is SWEET! Great job! Thanks again. MePH
MePHiTiC Posted November 27, 2007 Posted November 27, 2007 Curious, anyone else notice this script it eating 75+ megs of memory! This doesn't seem right. Anyone else? Thanks MePH
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