1
votes

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 Applescript Reference)

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

Any idea?

EDIT: Definitely there are 2 ways to launch and open a PPT file on Mac with Applescript:

In "speaker mode" the window shrinks but only a portion of the presentation is shown. the presentation is not resized but I can advance on mouse click.

In "window mode" the presentation is resized. I can view all the slide but I cannot advance on mouse click. (If I set the "window mode" manually, the mouse click works even if I THEN resize it with Applescript)

If I work on Windows this problem doesn't exist.

2
Wild guess: You probably have to tell PPT to start the slide show in viewed in a window mode rather than full screen. You'd need to change the slide show settings of the active presentation before launching it to do this.Steve Rindsberg
Thank Steve. When you say "slide show in viewed in a window mode", you mean to set show type to window? Because I did it with --show type of slide show settings of active presentation to slide show type WINDOW-- With this code the presentation is resized but I cannot advance with mouse click.. I don't know why.. Should I set "window mode" in any other place rather in show type?Miwi
In the slide show setup dialog, choose "Browsed by an individual (window)". That will advance with mouseclicks. If you choose "Browsed at a kiosk (full screen)" you might be able to set the window size but would have to add navigation buttons and such; kiosk mode disables all the usual keystrokes.Steve Rindsberg
@Steve Rindsberg I should do everything programmatically. After having set slide show to window the powerpoint seems to be corrupted and I can't fix it neither by the slide show setup dialog. The only way to make it work is to set (manually) in the set up dialog the speaker mode, save close Powerpoint and open it again to set it in window mode.Miwi

2 Answers

0
votes

Flying completely blind here, but what do you get if you do:

tell application "Microsoft PowerPoint"
set ssw to slide show window of it
properties of ssw
end tell

or

tell application "Microsoft PowerPoint"
set ssw to slide show window 1
properties of ssw
end tell

What I'm looking for are the window properties that hopefully can be changed. I'm hoping to get either height and width or (as is more commonly the case) the bounds of the slide show window. I'm just not clear on the syntax for PowerPoint (don't have it).

[edit] well, I see from the pdf docs that bounds is read-only. Hm. I'd have to get my hands on the sw to test.

0
votes

This (in VBA) will give you a window that displays the entire slide:

With ActivePresentation
  With .SlideShowSettings
    .showType = ppShowTypeWindow
    .ShowScrollbar = msoFalse ' might or might not need this
    .Run
  End with
  With .SlideShowWindow
    .Height = 300
    .Width = 400
  End With
End with

Your presentation will need some means of advancing itself (as you've noticed). You'd want to manually or programmatically add an advance button to each slide. Translation to Applescript is left to the discretion of the reader.