PPS Launcher 1.1

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: PPS Launcher 1.1

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

Very nicely coded :D!

PPS Launcher 1.1

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

Top