PPS Launcher 1.1

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK
Contact:

PPS Launcher 1.1

Post by trixmoto » Sun Jun 11, 2006 2:45 pm

As requested, this script automatically launches matching PowerPoint Slideshows automatically when tracks are played. By "matching" I mean the filename should be identical apart from the extension.

The installer can be downloaded from my website, but the code is simple so here it is:

[Typo corrected]

Code: Select all

'
' MediaMonkey Script
'
' NAME: PpsLauncher 1.1
'
' AUTHOR: trixmoto (http://trixmoto.net)
' DATE : 11/06/2006
'
' INSTALL: Copy to Scripts\Auto directory
'          Set WindowStyle parameter to appropriate value listed in link
'
' FIXES: Typo corrected
'

Option Explicit
Dim WindowStyle : WindowStyle = 1 'http://www.devguru.com/Technologies/wsh/quickref/wshshell_Run.html

Sub OnStartUp
  'register on-play event
  Script.RegisterEvent SDB, "OnPlay", "PpsLauncher"
End Sub

Sub PpsLauncher
  'get path of track
  Dim mp3f : mp3f = SDB.Player.CurrentSong.Path
  'find extension dot
  Dim i : i = InStrRev(mp3f,".")  
  'set path of slideshow to match
  Dim ppsf : ppsf = Left(mp3f,i)&"pps"
  'link to file system
  Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
  'check file exists
  If Not fso.FileExists(ppsf) Then Exit Sub  
  'link to shell
  Dim wsh : Set wsh = CreateObject("WScript.Shell")
  'run slideshow file
  i = wsh.Run(Chr(34)&ppsf&Chr(34),WindowStyle,0)
End Sub
Last edited by trixmoto on Mon Oct 23, 2006 5:52 am, edited 2 times in total.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm
Location: Belgium
Contact:

Post by Steegy » Sun Jun 11, 2006 3:18 pm

Very nicely coded :D!
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).

Post Reply