Modified VikingOSX script above to show progress bar
use scripting additions
set charList to {"?", "!"}
set theFont to "BookAntiqua-Bold"
set theColor to "blue"
set fontSize to 16
tell application "Pages"
activate
tell front document
set pageCount to count pages
set my progress description to "Changing Font (" & name & ")"
set my progress total steps to pageCount
repeat with pageIdx from 1 to pageCount
set my progress additional description to "Page " & pageIdx & " of " & pageCount
set my progress completed steps to pageIdx
tell body text of page pageIdx
repeat with achar in charList
set font of (characters of it where it is achar) to theFont
set color of (characters of it where it is achar) to theColor
# set size of (characters where it is achar) to fontSize
end repeat
end tell
end repeat
end tell
end tell
and here is a version that will have Pages jump to each page as it goes thru the documentâŠ
use scripting additions
set charList to {"?", "!"} as list
set theFont to "BookAntiqua-Bold"
set theColor to "blue"
set fontSize to 16
tell application "Pages"
activate
tell front document
set pageCount to count pages
set my progress description to "Changing Font (" & name & ")"
set my progress total steps to pageCount
tell application "System Events" to tell application process "Pages"
if frontmost = false then
set frontmost to true
delay 0.5
end if
click menu item "First Page" of menu "Go To" of menu item "Go To" of menu "View" of menu bar 1
end tell
repeat with pageIdx from 1 to pageCount
set my progress additional description to "Page " & pageIdx & " of " & pageCount
set my progress completed steps to pageIdx
tell body text of page pageIdx
repeat with achar in charList
set font of (characters of it where it is achar) to theFont
set color of (characters of it where it is achar) to theColor
# set size of (characters where it is achar) to fontSize
end repeat
end tell
tell application "System Events" to tell application process "Pages"
if frontmost = false then
set frontmost to true
delay 0.5
end if
click menu item "Next Page" of menu "Go To" of menu item "Go To" of menu "View" of menu bar 1
end tell
end repeat
end tell
end tell