I want to run PowerPoint slide show for only a particular slide.
After my research, I tried following but I did not get expected result.
Both of the scripts, starts slide show but from the first slide.
1)
`tell application "Microsoft PowerPoint"
activate
open "/Users/sanjeev/pppp.ppt"
set slideShowSettings to slide show settings of active presentation
set starting slide of slideShowSettings to 4
set ending slide of slideShowSettings to 4
run slide show slideShowSettings
end tell`
2)
`tell application "Microsoft PowerPoint"
activate
open "/Users/sanjeev/pppp.ppt"
set slideShowSettings to slide show settings of active presentation
run slide show slideShowSettings
go to slide slide show view of slide show window 1 number 4
end tell`
The second script gives an error also:
error "Microsoft PowerPoint got an error: slide show view of slide show window 1 doesn’t understand the go to slide message." number -1708 from slide show view of slide show window 1
I saw a question Want Applescript to change a Keynote presentation to a particular slide
But I think that works only for KeyNote.
Can anyone help?
Thanks
This seems to work. It looks buggy to me. When the script is run the screen goes black, then flashes the slide then goes black then finally displays the slide. I don't know if this is due to the script or the implementation of Applescript/ppt from Microsoft. I say the latter.
tell application "Microsoft PowerPoint"
set temp to active presentation's slide show settings
set temp's starting slide to 2
set temp's ending slide to 2
set temp's range type to slide show range
set temp's advance mode to slide show advance manual advance
run slide show temp
end tell
Related
I need a simple AppleScript that will cause PowerPoint to move to a specified slide number. I unfortunately am not familiar enough with AppleScript to properly interpret the information in the Applescript Library for PowerPoint. I think if someone can get me started I can take it from there.
The script just needs to reference the active presentation. If I could speak to my computer I just need to tell it to "go to slide #5" or "go to slide #2", etc.
The script needs to work while in Slideshow mode as the presentation will be running on a separate screen. Thanks so much for the help, I haven't been able to find this anywhere.
my gotoSlide(2)
on gotoSlide(whichSlide)
-- whichSlide is the integer position of the slide
tell application "Microsoft PowerPoint"
activate
tell active presentation
set theView to view of document window 1
go to slide theView number whichSlide
end tell
end tell
end gotoSlide
I'm using AppleScript to show PowerPoint slides as part of a manual testing/inspection step for code that generates the slides.
It's all working nicely, but I can't work out how to tell PowerPoint to zoom to 'fit' or 188% in my case.
set the zoom of the active window to 185 does nothing.
How do I get a reference to the property of interest here?
This works on Microsoft Office 2016, tested on Version 15.27:
-- Example: Set zoom to 188% --
tell application "Microsoft PowerPoint"
tell active window to set zoom of its view to 188
end tell
-- Example: Set zoom to fit --
tell application "Microsoft PowerPoint"
tell active window to set zoom to fit of its view to true
end tell
I have a templated Keynote file with some slides and all the slides each have 2 shapes in them. I want to be able to say something like, "hey give me shape 2 of slide 2". The purpose of this, is so that i can add text items directly to that shape. below is the code that I have right now.
I am using the latest Keynote 6.5.2 & Yosemite.
tell application "Keynote"
activate
tell document 1
set anniversary to "Anniversaries"
set myShape to shape 2 of slide 2
tell myShape
set thisTextItem to make new text item with properties {object text:anniversary}
#log thisTextItem
tell thisTextItem
set the size of its object text to 144
set the color of its object text to "blue"
end tell
end tell
end tell
end tell
I can tell slide 2 by itself and of course i get a big text item for slide 2 with text "Anniversaries" and colored blue but its only slide 2... not within shape 2 of slide 2.
With this code it gives me a pop up error when running the script:
Result:
error "Keynote got an error: Can’t make or move that element into that
container." number -10024
what does this mean? do i not have access to shapes within slides?? Any help/info/examples of setting text within a shape that is within a slide would be beneficial. Thanks!
You can set the properties of the text in a shape, you can't insert a text item object in a shape.
tell application "Keynote"
tell document 1
tell shape 2 of slide 2
set object text to "Anniversaries"
tell object text
set it's size to 44
set it's color to {0, 0, 65535} -- blue
end tell
end tell
end tell
end tell
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.
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.
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.
As the title says-
Is there a way to detect what slide is showing in a keynote presentation (using applescript)?
And yes, I am aware of how to change slides with applescript, I just need to detect what slide is already active.
SOLVED! >>> SEE BELOW
(Don't have enough reputation to answer my own question, so I'll just stick it here.)
I found a way round it thanks to this guy's script: http://code.google.com/p/keynotetweet/
For each slide in Keynote you get the option to attach invisible notes (not the yellow stickies, its a text box at the bottom of the page. Change the view to "Show Presenter Notes"). Here you can store a trigger string, ie "action". So create a keynote and put "action" in the notes of one slide. Start up the applescript then the slideshow, and when the slide with "action" in the notes is visible, the applescript will pick up it up and do whatever you set it to do.
repeat
tell application "Keynote"
set slideNotes to get notes of current slide of first slideshow
if text of slideNotes is equal to "action" then
say "Is this the slide you're looking for?"
end if
end tell
end repeat
Enjoy!
tell application "Keynote"
tell slideshow 1
get current slide
end tell
end tell
gives you
slide 3 of document "Untitled" of application "Keynote"