by XratedFozzibaer » Sun Jul 24, 2005 6:38 pm
Yeah, that plugin is really great!
I kinda combined the scripts and the plugin.
Now I can start MM, start playing, pause, start playing again and skip to next track with two buttons (two scripts).
Start MM, Play, Pause VBScript
- Code: Select all
'Check if mediamonkey is running
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'mediamonkey.exe'")
'MM is not running! Start it
If colProcesses.Count = 0 Then
Set WshShell = WScript.CreateObject("WScript.Shell")
Return = WshShell.Run("c:\programme\mediamonkey\mediamonkey.exe /nosplash", 1, true)
'MM is running! Play or Pause
Else
Dim SDB
Set SDB = CreateObject("SongsDB.SDBApplication")
While Not SDB.IsRunning
WEnd
'MM is paused or running? Then Play or Pause!
If SDB.Player.isPlaying And Not SDB.Player.isPaused Then
SDB.Player.Pause
Else
SDB.Player.Play
End If
'MM should not shut down on disconnect
SDB.ShutdownAfterDisconnect = False
'disassociate object variable ("SongsDB.SDBApplication") from actual object (SDB)
Set SDB = Nothing
End If
The path to MM has to be set in this script.
To skip to the next song I use the plugin (but it could be done with the script shown in a post above, too)
Thanks for all your suggestions!!!
Yeah, that plugin is really great!
I kinda combined the scripts and the plugin.
Now I can start MM, start playing, pause, start playing again and skip to next track with two buttons (two scripts).
Start MM, Play, Pause VBScript
[code]
'Check if mediamonkey is running
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'mediamonkey.exe'")
'MM is not running! Start it
If colProcesses.Count = 0 Then
Set WshShell = WScript.CreateObject("WScript.Shell")
Return = WshShell.Run("c:\programme\mediamonkey\mediamonkey.exe /nosplash", 1, true)
'MM is running! Play or Pause
Else
Dim SDB
Set SDB = CreateObject("SongsDB.SDBApplication")
While Not SDB.IsRunning
WEnd
'MM is paused or running? Then Play or Pause!
If SDB.Player.isPlaying And Not SDB.Player.isPaused Then
SDB.Player.Pause
Else
SDB.Player.Play
End If
'MM should not shut down on disconnect
SDB.ShutdownAfterDisconnect = False
'disassociate object variable ("SongsDB.SDBApplication") from actual object (SDB)
Set SDB = Nothing
End If
[/code]
The path to MM has to be set in this script.
To skip to the next song I use the plugin (but it could be done with the script shown in a post above, too)
Thanks for all your suggestions!!!