Help - Search - Members - Calendar
Full Version: PLAY Next/previous playlist with keyboard only (Columns UI)
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Support - (fb2k)
theprash
I've been setting up a nifty AutoHotKey script that will let me use my mouse as a remote control for foobar2000 and let me do rather a lot of things despite the fact that all I have is three buttons and a wheel. I might post the script here later when it's finished.

I'm using AHK to remap my mouse keys to global hotkeys already set up within foobar. I've set up shortcuts for next and previous playlist but they only work to a limited extent. The playlist view changes but foobar keeps playing the same playlist. It seems the only way to start playing is press up/down enter (see below) or double click, which is useless as this script takes complete control over all the mouse buttons. (this mouse remote control is designed to work even when you can't see the monitor)

Remember, I can use any keyboard shortcut solution but ideally it should work even when foobar is minimised. And it should play the first track in the playlist no matter which one is selected. (so mapping my mouse shortcut to the enter key is not a solution).

I suspect that what I ask for is impossible but I thought I'd ask anyway considering the number of tweak foobar tweak addicts out there who might've tried to do this already =]

Thanks.
foosion
If you can set your software to run a VBS script, you can install the COM Automation Server from my components page and use the following script with it. Save it to a file called switch-playlists.vbs. You might want to figure out how to parse command line arguments in VBS sou you can select whether to switch to the next or previous playlist. Alternatively, you can save two different versions of the script. smile.gif

CODE
Option Explicit

dim ProgID, HelperProgID
ProgId = "Foobar2000.Application.0.7"
HelperProgID = "Foobar2000.ApplicationHelper.0.7"

dim bStartAlways, bSwitchToNext

'set to true to start foobar2000 if it is not running
bStartAlways = false

'set to false to switch to previous playlist
bSwitchToNext = true

dim oApp

if bStartAlways then
set oApp = WScript.CreateObject(ProgID)
if isnull(oApp) then
WScript.Quit
end if
else
dim oHelper
set oHelper = WScript.CreateObject(HelperProgID)
if isnull(oHelper) or not oHelper.Running then
WScript.Quit
end if
set oApp = oHelper.Server
end if

dim oPlaylists, oPlaylist
dim nIndex, nCount

set oPlaylists = oApp.Playlists
set oPlaylist = oPlaylists.ActivePlaylist

if isnull(oPlaylist) then
nIndex = 0
else
nIndex = oPlaylist.Index
nCount = oPlaylists.Count
if bSwitchToNext then
nIndex = nIndex + 1
if nIndex >= nCount then
nIndex = 0
end if
else
nIndex = nIndex - 1
if nIndex < 0 then
nIndex = nCount - 1
end if
end if
end if

set oPlaylist = oPlaylists(nIndex)
oPlaylists.ActivePlaylist = oPlaylist
oPlaylist.DoDefaultAction 0
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.