sjboyington Posted March 6, 2014 Posted March 6, 2014 Hi Ive basically got a script that loads a power point from the network, copys it to C: and loops it until it detects the file has been modified with a newer version. At this point, the machine is restarted, it auto logs in, copys the new script to C:, replacing the old one and then plays it on a loop until it is revised again. I now want to expand that if possible so it could have 6 files (one for monday to friday and a master file). The master file would be the one it opens if it is the newest modification date, else it would open the relevant file per day. As it stands we have 18 VDUs in different areas of the academy with the below script running and im editing the PPT per day (the PPT is repeated weekly) to display relevant info for that area, however they want all 18 VDUs to display the same info on occasion. Any Ideas? On Error Resume Next WScript.sleep 120000 Const ppAdvanceOnTime = 2 ' Run according to timings (not clicks) Const ppShowTypeKiosk = 3 ' Run in "Kiosk" mode (fullscreen) Const ppAdvanceTime = 5 ' Show each slide for 10 seconds ' Open the two power point files to work with them. Set objFileSys = CreateObject("Scripting.FileSystemObject") Set CurrentPPT = objFileSys.GetFile("c:\presentations\FOXVDU01.pptx") Set NewPPT = objFileSys.GetFile("y:\presentations\FOXVDU01.pptx") ' Open the shell object for passing commands. Set objShell = CreateObject("WScript.Shell") Set objPPT = CreateObject("PowerPoint.Application") objPPT.Visible = True Set objPresentation = objPPT.Presentations.Open(currentPPT.Path) ' Apply powerpoint settings objPresentation.Slides.Range.SlideShowTransition.AdvanceOnTime = TRUE objPresentation.SlideShowSettings.AdvanceMode = ppAdvanceOnTime objPresentation.SlideShowSettings.ShowType = ppShowTypeKiosk objPresentation.Slides.Range.SlideShowTransition.AdvanceTime = ppAdvanceTime objPresentation.SlideShowSettings.LoopUntilStopped = True ' Run the slideshow Set objSlideShow = objPresentation.SlideShowSettings.Run.View Do Until Err <> 0 If NewPPT.DateLastModified > CurrentPPT.DateLastModified Then objPresentation.Close objFileSys.CopyFile NewPPT, CurrentPPT, True Set CurrentPPT = objFileSys.GetFile("c:\presentations\FOXVDU01.pptx") Set objSlideShow = objPresentation.SlideShowSettings.Run.View End If Loop objPresentation.Saved = False objPresentation.Close objPPT.Quit Thanks Steve
sjboyington Posted March 7, 2014 Author Posted March 7, 2014 FYI On Error Resume Next WScript.sleep 90000 Const ppAdvanceOnTime = 2 ' Run according to timings (not clicks) Const ppShowTypeKiosk = 3 ' Run in "Kiosk" mode (fullscreen) Const ppAdvanceTime = 5 ' Show each slide for 10 seconds ' Open the 4 power point files to work with them. Set objFileSys = CreateObject("Scripting.FileSystemObject") Set CurrentPPT = objFileSys.GetFile("c:\presentations\FOXVDU01.pptx") Set CurrentPPT2 = objFileSys.GetFile("c:\presentations\master.pptx") Set NewPPT = objFileSys.GetFile("y:\presentations\FOXVDU01.pptx") Set NewPPT2 = objFileSys.GetFile("y:\presentations\master.pptx") 'Checks modified date of the powerpoint and replaces it as needed. If NewPPT.DateLastModified > CurrentPPT.DateLastModified Then objFileSys.CopyFile NewPPT, CurrentPPT, True End If 'Checks modified date of the powerpoint and replaces it as needed. If NewPPT2.DateLastModified > CurrentPPT2.DateLastModified Then objFileSys.CopyFile NewPPT2, CurrentPPT2, True End If ' Open the shell object for passing commands. Set objShell = CreateObject("WScript.Shell") Set objPPT = CreateObject("PowerPoint.Application") objPPT.Visible = True 'Checks modified date of each of the powerpoints and sets current path to the newest powerpoint. If CurrentPPT.DateLastModified > CurrentPPT2.DateLastModified Then Set objPresentation = objPPT.Presentations.Open(currentPPT.Path) Else Set objPresentation = objPPT.Presentations.Open(currentPPT2.Path) End If ' Apply powerpoint settings objPresentation.Slides.Range.SlideShowTransition.AdvanceOnTime = TRUE objPresentation.SlideShowSettings.AdvanceMode = ppAdvanceOnTime objPresentation.SlideShowSettings.ShowType = ppShowTypeKiosk objPresentation.Slides.Range.SlideShowTransition.AdvanceTime = ppAdvanceTime objPresentation.SlideShowSettings.LoopUntilStopped = True ' Run the slideshow Set objSlideShow = objPresentation.SlideShowSettings.Run.View Do Until Err <> 0 Loop objPresentation.Saved = False objPresentation.Close objPPT.Quit This script looks at 2 files, one for the TV and a master. It then copies them from the serever share to the OS and replaces any older version of the file. It then opens which ever was modified last and will display on a powerpoint in a loop until the machine is restarted. At that point it will check for a newer version of the file. Yes there isn't a file per day but in theory, it could be tweaked to allow for that. This just gives whole school broadcast on multiple VDUs or individual usage - dependant on which file was modified last. Hope ithelps someone in the future.
3s-gtech Posted March 7, 2014 Posted March 7, 2014 Or try Xibo! Gives the control without the scripting; with schedules, individual screen control, etc etc. It's free and doesn't need much of a server to run.
sjboyington Posted March 10, 2014 Author Posted March 10, 2014 I m currently expanding on the script I made but having no knowledge on scripts - its a learning curve. part of the script reads the day and then gives me a constant called "TodaysPPT", which I use later in the script. CurrentDay = WeekdayName(Weekday((dtmValue)+2)) wscript.echo CurrentDay TodaysPPT = "CurrentMaster+(CurrentDay)" wscript.echo TodaysPPT Basically, for this test, I want it to echo the day back which it does and then create the constant "TodaysPPT" which should have a value of the words "CurrentMaster" and the day it just returned. For example, On Monday, it would return a value for TodaysPPT of CurrentMasterMonday. Friday would be CurrentMasterFriday. I just am not quite sure of how to add both parts to get the correct value for "TodaysPPT". Thanks Steve I Will post the complete script after this. Fully automated Powerpoints across site with no need or third party software or maintenance by IT. All from a local dive and day dependant.
sjboyington Posted March 10, 2014 Author Posted March 10, 2014 Have a look at ShowPoint maybe? That looks good if it was one powerpoint I was using, however I want one per day. I just need to sort the above line out and then mine will do as the suggested app does except it waits for reboot to update and will look at a file relevant to that device only (NetBIOS name) and a power point per day, playing either the powerpoint for that day OR the specific one for that device, dependant on which as modified last. thanks though.
sjboyington Posted March 10, 2014 Author Posted March 10, 2014 RESOVLED CurrentDay = WeekdayName(Weekday((dtmValue)+2)) wscript.echo CurrentDay TodaysPPT = "CurrentMaster" & CurrentDay wscript.echo TodaysPPT
sjboyington Posted March 10, 2014 Author Posted March 10, 2014 On Error Resume Next WScript.sleep 90000 Const ppAdvanceOnTime = 2 ' Run according to timings (not clicks) Const ppShowTypeKiosk = 3 ' Run in "Kiosk" mode (fullscreen) Const ppAdvanceTime = 5 ' Show each slide for 10 seconds ' ------------------Open the 6 power point files to work with them - Old and new versions------------. Set objFileSys = CreateObject("Scripting.FileSystemObject") Set CurrentPPT = objFileSys.GetFile("c:\presentations\FOXVDU01.pptx") Set CurrentMasterMonday = objFileSys.GetFile("c:\presentations\MasterMonday.pptx") Set CurrentMasterTuesday = objFileSys.GetFile("c:\presentations\MasterTuesday.pptx") Set CurrentMasterWednesday = objFileSys.GetFile("c:\presentations\MasterWednesday.pptx") Set CurrentMasterThursday = objFileSys.GetFile("c:\presentations\MasterThursday.pptx") Set CurrentMasterFriday = objFileSys.GetFile("c:\presentations\MasterFriday.pptx") Set NewPPT = objFileSys.GetFile("y:\presentations\FOXVDU01.pptx") Set NewMasterMonday = objFileSys.GetFile("y:\presentations\MasterMonday.pptx") Set NewMasterTuesday = objFileSys.GetFile("y:\presentations\MasterTuesday.pptx") Set NewMasterWednesday = objFileSys.GetFile("y:\presentations\MasterWednesday.pptx") Set NewMasterThursday = objFileSys.GetFile("y:\presentations\MasterThursday.pptx") Set NewMasterFriday = objFileSys.GetFile("y:\presentations\MasterFriday.pptx") '------------------Checks modified date of the VDU powerpoint and replaces it as needed-------------------. If NewPPT.DateLastModified > CurrentPPT.DateLastModified Then objFileSys.CopyFile NewPPT, CurrentPPT, True End If 'Checks modified date of the MasterMonday powerpoint and replaces it as needed. If NewMasterMonday.DateLastModified > CurrentMasterMonday.DateLastModified Then objFileSys.CopyFile NewMasterMonday, CurrentMasterMonday, True End If 'Checks modified date of the MasterTuesday powerpoint and replaces it as needed. If NewMasterTuesday.DateLastModified > CurrentMasterTuesday.DateLastModified Then objFileSys.CopyFile NewMasterTuesday, CurrentMasterTuesday, True End If 'Checks modified date of the MasterWednesday powerpoint and replaces it as needed. If NewMasterWednesday.DateLastModified > CurrentMasterWednesday.DateLastModified Then objFileSys.CopyFile NewMasterWednesday, CurrentMasterWednesday, True End If 'Checks modified date of the MasterThursday powerpoint and replaces it as needed. If NewMasterThursday.DateLastModified > CurrentMasterThursday.DateLastModified Then objFileSys.CopyFile NewMasterThursday, CurrentMasterThursday, True End If 'Checks modified date of the MasterFriday powerpoint and replaces it as needed. If NewMasterFriday.DateLastModified > CurrentMasterFriday.DateLastModified Then objFileSys.CopyFile NewMasterFriday, CurrentMasterFriday, True End If ' ---------------- Reads the current day from the system and assigns current PPT Day to TodaysPPT------------. CurrentDay = WeekdayName(Weekday((dtmValue)+2)) TodaysPPT = "Master" & CurrentDay & ".pptx" Set Today = objFileSys.GetFile("C:\presentations\" & TodaysPPT) ' Open the shell object for passing commands. Set objShell = CreateObject("WScript.Shell") Set objPPT = CreateObject("PowerPoint.Application") objPPT.Visible = True '--------------Checks modified date of each of the powerpoints and sets current path to the newest powerpoint--------------. If CurrentPPT.DateLastModified > Today.DateLastModified Then Set objPresentation = objPPT.Presentations.Open(currentPPT.Path) Else Set objPresentation = objPPT.Presentations.Open(Today.Path) End If ' Apply powerpoint settings objPresentation.Slides.Range.SlideShowTransition.AdvanceOnTime = TRUE objPresentation.SlideShowSettings.AdvanceMode = ppAdvanceOnTime objPresentation.SlideShowSettings.ShowType = ppShowTypeKiosk objPresentation.Slides.Range.SlideShowTransition.AdvanceTime = ppAdvanceTime objPresentation.SlideShowSettings.LoopUntilStopped = True ' Run the slideshow Set objSlideShow = objPresentation.SlideShowSettings.Run.View Do Until Err <> 0 Loop objPresentation.Saved = False objPresentation.Close objPPT.Quit COMPLETE SCRIPT IF ANYONE EVER NEEDS IT 1
sjboyington Posted March 11, 2014 Author Posted March 11, 2014 On Error Resume Next WScript.sleep 90000 Const ppAdvanceOnTime = 2 ' Run according to timings (not clicks) Const ppShowTypeKiosk = 3 ' Run in "Kiosk" mode (fullscreen) Const ppAdvanceTime = 5 ' Show each slide for 10 seconds ' ------------------Open the 6 power point files to work with them - Old and new versions------------. Set objFileSys = CreateObject("Scripting.FileSystemObject") Set CurrentPPT = objFileSys.GetFile("c:\presentations\FOXVDU01.pptx") Set CurrentMasterMonday = objFileSys.GetFile("c:\presentations\MasterMonday.pptx") Set CurrentMasterTuesday = objFileSys.GetFile("c:\presentations\MasterTuesday.pptx") Set CurrentMasterWednesday = objFileSys.GetFile("c:\presentations\MasterWednesday.pptx") Set CurrentMasterThursday = objFileSys.GetFile("c:\presentations\MasterThursday.pptx") Set CurrentMasterFriday = objFileSys.GetFile("c:\presentations\MasterFriday.pptx") Set NewPPT = objFileSys.GetFile("y:\presentations\FOXVDU01.pptx") Set NewMasterMonday = objFileSys.GetFile("y:\presentations\MasterMonday.pptx") Set NewMasterTuesday = objFileSys.GetFile("y:\presentations\MasterTuesday.pptx") Set NewMasterWednesday = objFileSys.GetFile("y:\presentations\MasterWednesday.pptx") Set NewMasterThursday = objFileSys.GetFile("y:\presentations\MasterThursday.pptx") Set NewMasterFriday = objFileSys.GetFile("y:\presentations\MasterFriday.pptx") '------------------Checks modified date of the VDU powerpoint and replaces it as needed-------------------. If NewPPT.DateLastModified > CurrentPPT.DateLastModified Then objFileSys.CopyFile NewPPT, CurrentPPT, True End If 'Checks modified date of the MasterMonday powerpoint and replaces it as needed. If NewMasterMonday.DateLastModified > CurrentMasterMonday.DateLastModified Then objFileSys.CopyFile NewMasterMonday, CurrentMasterMonday, True End If 'Checks modified date of the MasterTuesday powerpoint and replaces it as needed. If NewMasterTuesday.DateLastModified > CurrentMasterTuesday.DateLastModified Then objFileSys.CopyFile NewMasterTuesday, CurrentMasterTuesday, True End If 'Checks modified date of the MasterWednesday powerpoint and replaces it as needed. If NewMasterWednesday.DateLastModified > CurrentMasterWednesday.DateLastModified Then objFileSys.CopyFile NewMasterWednesday, CurrentMasterWednesday, True End If 'Checks modified date of the MasterThursday powerpoint and replaces it as needed. If NewMasterThursday.DateLastModified > CurrentMasterThursday.DateLastModified Then objFileSys.CopyFile NewMasterThursday, CurrentMasterThursday, True End If 'Checks modified date of the MasterFriday powerpoint and replaces it as needed. If NewMasterFriday.DateLastModified > CurrentMasterFriday.DateLastModified Then objFileSys.CopyFile NewMasterFriday, CurrentMasterFriday, True End If ' ---------------- Reads the current day from the system and assigns current PPT Day to TodaysPPT------------. currdate = now() currid = weekday(currdate) CurrentDay = weekdayname(currid) TodaysPPT = "Master" & CurrentDay & ".pptx" Set Today = objFileSys.GetFile("C:\presentations\" & TodaysPPT) ' Open the shell object for passing commands. Set objShell = CreateObject("WScript.Shell") Set objPPT = CreateObject("PowerPoint.Application") objPPT.Visible = True '--------------Checks modified date of each of the powerpoints and sets current path to the newest powerpoint--------------. If CurrentPPT.DateLastModified > Today.DateLastModified Then Set objPresentation = objPPT.Presentations.Open(currentPPT.Path) Else Set objPresentation = objPPT.Presentations.Open(Today.Path) End If ' Apply powerpoint settings objPresentation.Slides.Range.SlideShowTransition.AdvanceOnTime = TRUE objPresentation.SlideShowSettings.AdvanceMode = ppAdvanceOnTime objPresentation.SlideShowSettings.ShowType = ppShowTypeKiosk objPresentation.Slides.Range.SlideShowTransition.AdvanceTime = ppAdvanceTime objPresentation.SlideShowSettings.LoopUntilStopped = True ' Run the slideshow Set objSlideShow = objPresentation.SlideShowSettings.Run.View Do Until Err <> 0 Loop objPresentation.Saved = False objPresentation.Close objPPT.Quit COMPLETE SCRIPT IF ANYONE EVER NEEDS IT My apologies but the get day coding was wrong. Above is the final completed script if anyone ever needs it. Looks at 6 powerpoints. Mon - Fri and a netbios name specific and the runs either the specific or relevant day dependent on date modified. Thanks
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now