views:

533

answers:

4

I was wondering how I can make a script load powerpoint file, advance slides automatically and put it on full screen. Is there a way to make windows do that? Can I just load powerpoint.exe and maybe use some sort of API/Pipe to give commands from another script.

To make a case: I'm making a script that automatically scans a folder in windows (using python) and loads up the powerpoint presentations and keeps playing them in order.

+1  A: 

One solution for you would be to use the PowerPoint Viewer program instead. PPT Viewer is set to open a PowerPoint file straight away in Presentation mode.

Alternatively, you can use the argument /s to start Powerpoint.

"powerpoint.exe /s <filename>.ppt"

This will be equivalent to telling PowerPoint to straight away open up in Presentation mode.

scoopdreams
DaveParillo
To do this from Python, you would probably use the subprocess module.
Jason R. Coombs
I did end up using this solution but used win32com to actually generate slides instead of going through the process of synchronizing these different slides..
pvsnp
A: 

As previously stated, this is more StackOverflow geared, but this can easily be achieved with Python and AutoHotkey.

On the Python side of things, as a general idea on how to go about this (I'm kind of rusty, beware!):

  • Find files using os.walk()
  • Append each to a list, then iterate over the list, opening each one with os.system("powerpoint.exe /s filename"). The next one should not open until the previous closes.

AutoHotkey wise:

  • Once opened, use #IfWinActive to detect an open Powerpoint window, and send mouse clicks to change slides at a set interval

I don't know what you mean by "order", you'll have to determine that in your Python script. If you want them alphabetical, sort the list alphabetically then iterate. If you want them sorted by creation date, then sort by date and iterate and so on.

John T
A: 

If you want more control over the powerpoint slide, you could write something in VB.Net (or other .Net languages) according to this MS support article.

If you wanted direct control from Python, you could probably use pywin32 or comtypes to invoke directly the same interfaces as described in the MS article. My guess is this is the most powerful solution and would probably provide the smoothest transitions between presentations, but is probably a lot more work than using subprocess to call into PowerPoint.

Jason R. Coombs
A: 

Save the file with the extension ".pps". That will make powerpoint open the file in presentation mode. The presentaion needs to designed to advance slides, else you will have to script that part.