Resize Powerpoint Slideshow Window

My first post… :slight_smile: I hope to help someone in the future… :slight_smile:

My question…

I’m trying to resize the slideshow window using Applescript and Powerpoint 2011 for Mac.

In the past I’ve used VBA to do the job, but here it seems impossible to do with Applescript. The script is:


tell application "Microsoft PowerPoint"

set show type of slide show settings of active presentation to slide show type speaker

set theSSW to run slide show slide show settings of active presentation

set height of theSSW to 300

set width of theSSW to 400

end tell

(the script above is directly copied from Applescriptref pdf)

The problem is that the slideshow window is cropped but not resized. That is making me crazy.

Any idea?

Try this:

tell application "Microsoft PowerPoint"
	activate
	run slide show slide show settings of active presentation
	set theSSW to the slide show window of active presentation
	set height of theSSW to 300
	set width of theSSW to 400
end tell

Thanks for the answer, but the result is the same.

:confused:

The routine works for me. It actually resizes the window. Unfortunately, it only shows the upper left corner in the resize and does not shrink the slides to fit.

I have had problems getting things to work correctly running PowerPoint inside Applescript when I used the “ignoring messages” command. I found that if I call and run the PowerPoint file directly, everything after that works correctly. Here’s the command structure I found to work for me along with some great help from others on this site. There is a problem in the time necessary to get PowerPoint started and the presentation file loaded. Just run it a second time and it will run just fine.

on runPowerPoint(powerPointFile)
	set powerPointFile to POSIX path of powerPointFile
	do shell script "open -b com.microsoft.PowerPoint " & quoted form of powerPointFile
	tell application id "com.apple.systemevents"
		repeat while true
			set PowerPointUp to (count of (every process whose name is "Microsoft PowerPoint")) > 0
			if PowerPointUp then
				exit repeat
			else
				delay 0.2
			end if
		end repeat
	end tell
	
	tell application "Microsoft PowerPoint"
		activate
		repeat until document window 1 exists
			delay 0.2
		end repeat
		run slide show slide show settings of active presentation
	end tell
end runPowerPoint

This will start the PowerPoint presentation. Now if you run the following, it should resize.

tell application "Microsoft PowerPoint"
	activate
	set theSSW to the slide show window of active presentation
	set height of theSSW to 300
	set width of theSSW to 400
end tell

Your routine open the Powerpoint correctly and shrink the Presentation, but doesn’t resize it. Right?
I’m looking for a way to resize the window correctly.