![](/sites/all/themes/custom_front/images/you_are_here_red.gif)
![](/sites/default/files/beta-site.gif)
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 28
if has text of (text frame of theShape) then
--note: 'text range', not 'text object' of text frame
set theRange to text range of text frame of theShape
my ReplaceInRange(findText, replaceText, theRange)
end if
end repeat
-- now in the headers and footers of each section
set allSections to every section of active document
repeat with theSection in allSections
set theHeaderFooters to {get header theSection index ¬
header footer primary} & {get header theSection index ¬
header footer first page} & {get header theSection index ¬
header footer even pages} & {get footer theSection index ¬
header footer primary} & {get footer theSection index ¬
header footer first page} & {get footer theSection index ¬
header footer even pages}
repeat with theHeaderFooter in theHeaderFooters
set theRange to text object of theHeaderFooter
my ReplaceInRange(findText, replaceText, theRange)
--now in their shapes
set allShapes to (every shape of theHeaderFooter)
repeat with theShape in allShapes
if has text of (text frame of theShape) then
--note: 'text range', not 'text object' of text frame
set theRange to text range of text frame of theShape
< Previous Page Next Page>
![](/sites/all/themes/custom_front/img/search_text.gif)
- SPREAD THE WORD:
- Slashdot
- Digg
- Del.icio.us
- Newsvine