PPS Launcher 1.1

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

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

PPS Launcher 1.1

Post by trixmoto »

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.
Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm

Post by Steegy »

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