

You can also save a presentation into a new path, or in a different format.

This will cause the presentation to be saved in its original format back to its original path. To save a presentation that has been saved previously, use the save command, as follows: tell application "Microsoft PowerPoint"

> presentation 1 of application "Microsoft PowerPoint" Saving a Presentation
Mac script + for powerpoint full#
Set theOpenedPresentation to first presentation whose full name = (thePath as string) set thePath to choose file with prompt "Please select a presentation:"
Mac script + for powerpoint how to#
The following code demonstrates how to open a presentation, and then build a reference to the opened presentation by matching the opened path to the presentation's full name property. A presentation's path can be found by referencing its full name property. To ensure an accurate reference to the newly opened presentation, locate the presentation whose file path is equal to the path from which the presentation was just opened. While you could reference the active presentation property of the application, this is not always the safest method.

Therefore, if your code will begin processing the newly opened presentation, you will need to form a reference to that presentation. When using the open command, please note that a result is not returned. For example: set thePath to choose file with prompt "Please select a presentation:" To open a presentation file on disk, use the open command. Keep this in mind if you ever find that your code is not targeting the anticipated presentation, and verify the presentation ordering. If another presentation is brought to the front, then this reference will begin pointing to that presentation. Note that the code above results in an ambiguous reference to the active presentation of the application, and not a specific presentation. > active presentation of application "Microsoft PowerPoint" To ensure reference to the front most presentation, refer to the active presentation property of the application class instead, as demonstrated by the example code below. So, it is never safe to assume that presentation 1 is the front most presentation. Rather, it refers to the order in which the presentation was opened or created, in reference to the other currently opened presentations. However, unlike many other applications, a PowerPoint presentation's index does not refer to its front to back ordering. Like documents in most applications, presentations can be referenced by index. It's important to understand how to reference the front most presentation in PowerPoint. This may be placed into a variable, if desired, for future reference throughout your code. The result of the make command is a reference to the newly created presentation. > presentation "Presentation1" of application "Microsoft PowerPoint" To create a new presentation, use the make command, followed by the presentation class, as demonstrated here. In PowerPoint, the base class in which you will work is a presentation. Working with Presentations Making a Presentation In future versions of PowerPoint, much of the terminology we will discuss is likely to remain functional, although it is always good practice to test code for terminology changes when performing any application upgrades in a scripted workflow. In this month's column, we will explore the AppleScript support in PowerPoint 11, released with Office 2004. Furthermore, Microsoft has announced that Visual Basic support will be removed from the Office applications when Office 2008 is released, thus rendering any do Visual Basic code useless moving forward. But, this isn't necessary anymore, as AppleScript code can now be written to perform repetitive tasks directly. Sure, you can still use the do Visual Basic command to automate PowerPoint, if you wish. Word and Excel both had their AppleScript dictionaries substantially re-written and expanded, and PowerPoint introduced extensive AppleScript support. With the release of Office 2004, Microsoft introduced re-worked AppleScript support in the Office applications. Of course, to do this, one needed to be fluent in Visual Basic. While no direct AppleScript-ability was present, this command at least provided a way to initiate Visual Basic macrocode from AppleScript in order to automate some tasks. In Office X, PowerPoint's AppleScript dictionary contained a single command - do Visual Basic. We have discussed Word and Excel scripting, and this month, we are going to focus on scripting PowerPoint. In recent months, we have been discussing ways to automate the Office applications using AppleScript. Introduction to Scripting Microsoft PowerPointĬolumn Tag: Scripting AppleScript Essentials Introduction to Scripting Microsoft PowerPoint Educational Institution and Student Discounts.
