Applescript to set font attributes?

S

snnopy67

With the old PPT (2004 it was, I think),
I used to have a button that would execute a VBA macro that would set
a number of font attributes for the currently highlighted text.

Is it posible somehow to have such a button with the new PPT (2008),
too?
I suppose it would have to be linked to an applescript.

Problem is: i seem to be unable to grasp applescript (although i'm
pretty fluent in c++ and bash, etc.); and, furthermore, I have *no*
idea, how to define a new button in PPT, and how to link it to an
applescript ;-(

Could some kind soul please give me some hints?

Thanks a lot in advance.

Best regards,
Gabriel.

PS:
The font attributes I would like to set are
subscript and (font size = current font size + 2) and subscript offset
= -13%.
 
S

Steve Rindsberg

With the old PPT (2004 it was, I think),
I used to have a button that would execute a VBA macro that would set
a number of font attributes for the currently highlighted text.

Is it posible somehow to have such a button with the new PPT (2008),
too?
I suppose it would have to be linked to an applescript.

I don't think so. Getting the button to do anything would require VBA,
and if you're in 2008, VBA has left the building.

You could probably add an applescript item to the whatsit, script menu
on the main Mac menu bar, though.

I mentioned Paul Berkowitz' VBA to Applescript Transition Guide in an
earlier post. I got over The Lazies and have found the URL:

http://www.mactech.com/vba-transition-guide/index-001.html

That'll help you translate the various VBA example code bits out there
to Applescript.
 
S

snnopy67

Thanks a lot for your response!

Since I have abolutely no experience with applescript doing something
with powerpoint, allow me one more question:

So the idea is to write an applescript that is completely outside of
powerpoint, and make that trigger something within powerpoint?

Best regards,
Gabriel.
 
S

snnopy67

Thanks a lot for your response!

Since I have abolutely no experience with applescript doing something
with powerpoint, allow me one more question:

So the idea is to write an applescript that is completely outside of
powerpoint, and make that trigger something within powerpoint?

Best regards,
Gabriel.
 
S

Steve Rindsberg

Thanks a lot for your response!

Since I have abolutely no experience with applescript doing something
with powerpoint, allow me one more question:

So the idea is to write an applescript that is completely outside of
powerpoint, and make that trigger something within powerpoint?

Got it in one. That's exactly it. Since you can't host applescript
*within* powerpoint, that's the only option.
 
S

snnopy67

Well, I read up a bit in the MacTech article, and on MacTopia, but now
I'm stuck on this ubiquitous GetSelectedShape() handler.
When I copy it from the MacTopia pages, it doesn't work, of course,
because ppt 2008 doesn't have VBA any more ...

All I want to do is iths:

ActiveWindow.Selection.TextRange.Font.subscript = msoTrue
ActiveWindow.Selection.TextRange.Font.BaselineOffset = -0.2

If ActiveWindow.Selection.TextRange.Font.Size < 20 Then
ActiveWindow.Selection.TextRange.Font.Size =
ActiveWindow.Selection.TextRange.Font.Size + 2
Else
ActiveWindow.Selection.TextRange.Font.Size =
ActiveWindow.Selection.TextRange.Font.Size + 4
End If

Regards,
Gabriel.
 
S

Steve Rindsberg

Well, I read up a bit in the MacTech article, and on MacTopia, but now
I'm stuck on this ubiquitous GetSelectedShape() handler.
When I copy it from the MacTopia pages, it doesn't work, of course,
because ppt 2008 doesn't have VBA any more ...

All I want to do is iths:

ActiveWindow.Selection.TextRange.Font.subscript = msoTrue
ActiveWindow.Selection.TextRange.Font.BaselineOffset = -0.2

If ActiveWindow.Selection.TextRange.Font.Size < 20 Then
ActiveWindow.Selection.TextRange.Font.Size =
ActiveWindow.Selection.TextRange.Font.Size + 2
Else
ActiveWindow.Selection.TextRange.Font.Size =
ActiveWindow.Selection.TextRange.Font.Size + 4
End If[/QUOTE]

And I'm afraid I can't offer much help; I don't have 2008 ... it's got
no VBA ... who'd WANT it? ;-) And while I helped Paul with the article,
it was only from the "Here's the kind of thing we do with PPT in VBA"
side. He did all the translation to applescript.
 
S

snnopy67

And I'm afraid I can't offer much help; I don't have 2008 ... it's got
no VBA ... who'd WANT it? ;-)  

Well, it does have a few very simple, but very important improvements
over 2004, for instance, in slide sorter, you can zoom up too 400% --
which is extreeeemly helpful for me.

Anyway, thanks again.

Best regards,
Gabriel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top