r/applescript • • May 01 '23

Adding a slide to Microsoft PowerPoint presentation

Hey folks, totally new to Apple Script but I was trying to create a new presentation on Microsoft PowerPoint using the script and then adding a new slide to the presentation. However, I keep getting this error: "Microsoft PowerPoint got an error: Can't make or move that element into that container" -10024.

My script is pretty simple and as follows:

tell application "Microsoft PowerPoint" activate set newPresentation to make new presentation set newSlide to make new slide set savePath to (path to desktop as string) & "MyPresentation.pptx" save newPresentation in savePath end tell.

In all honesty, this is what ChatGPT gave me but after scouring through other sites as well I can't find any other way to go about making/adding a slide.

PowerPoint version: 16.72 Mac OS: 12.6.1

2 Upvotes

6 comments sorted by

View all comments

Show parent comment

1

u/Serious-Speed6957 May 02 '23

Weird - this doesn't seem to work either.

And what's more weird is you can't add a simple slide to PowerPoint using AppleScript???