san
san

Reputation: 3328

Applescript command to extract template from a powerpoint presentation

I need to extract the template from a powerpoint presentation and apply that template to another presentation.

After my search, I found two commands:

1) get template name of presentation

The above commands gives the template name, but not the path where it is stored. I am unable to find that.

2) apply template presentation file name "Macintosh HD:Users:Shared:Zesty"

The above command applies the "Zesty" design template to the presentation. But again I had no success as I don't know where this design template is stored. After googling I found the location can be: "/Users/sanjeev/Library/Application\ Support/Microsoft/Office/User\ Templates ". But I found no templates there.

So, is there any way to extract the template from a powerpoint presentation and apply that template to another presentation??

Thanks

Upvotes: 0

Views: 396

Answers (2)

Martin Packer
Martin Packer

Reputation: 763

This might be 10 years late :-) but here is some AppleScript that does it:

-- Create a presentation to write to
set newPresentation to make new presentation
        
-- apply a template file to this new presentation
apply template newPresentation file name "/Users/martinpacker/Documents/template.potx"

(Obviously I came across this question while looking for an answer myself - and eventually figured it out. It might help someone in another decade or so.) :-)

Upvotes: 1

Steve Rindsberg
Steve Rindsberg

Reputation: 3528

PowerPoint doesn't store the path to templates in presentation files. There's no need to. It never refers to external templates except when the user/your code applies them. At that point, it stores a copy of the template IN the PPT file.

Extracting a template from the PPT file is simply a matter of opening the file and saving it as a template.

But you don't even need to do that unless you want to. Since every presentation contains its own template, you can apply the template from one presentation to another; no need for an actual template file.

In VBA, you'd do:

ActivePresentation.ApplyTemplate FileName:="[path to file whose template you want to apply"

I don't do Applescript, but it should be possible to translate that.

Upvotes: 1

Related Questions