

Moving from Microsoft Office VBA to AppleScript:
MacTech's Guide to Making the Transition
Introduction
|
Table of Contents
Page Prev and Page Next buttons at bottom of the page.
|
April, 2007
Page 102
"Different text depending on context."
end if
end tell
on IsSafeToTouch(selectedShape)
tell application "Microsoft PowerPoint"
try -- to avoid error messages if shape has no text frame or no text
tell selectedShape
if has text frame then -- does it have one?
--if so, does the text frame have any text?
if has text of its text frame then -- needs 'its'
return true
else
return false
end if
else
return false
end if
end tell
on error
return false
end try
end tell
end IsSafeToTouch
Format the Text Font, Color and Style
Formatting text is quite straightforward, and the AppleScript properties mirror the VBA ones, both in name and function:
Sub TextFormatting()
With ActiveWindow.Selection.ShapeRange
' work with all the text in the shape
With .TextFrame.TextRange
' Change font formatting
With .Font
.Name = "Arial"
.Size = 24
' make it red
.Color.RGB = RGB(255, 0, 0)
.Bold = True
' and so on
End With
End With
End With
End Sub
In AppleScript that becomes:
tell application "Microsoft PowerPoint"
--get the selected shape via the handler
< Previous Page Next Page>

- SPREAD THE WORD:
- Slashdot
- Digg
- Del.icio.us
- Newsvine