Conscience was bothering me and I have restructured the code to replace the original submission. Same functionality in Pages as previous.
(*
Name: TextBoxReveal.applescript
Type: Automator Service
App: Pages ’09 v4.3
Author: VikingOSX, Apple Support Community
Date: Sept. 20, 2013
Version: 1.1
Pages service with user interaction to reveal/hide all document text boxes.
Run once to reveal, run again to hide.
*)
property bxBlue : {0, 0, 65535}
property bxRed : {65535, 0, 0}
property bxGrn : {0, 65535, 0}
property bxBlk : {0, 0, 0}
tell application "Pages"
tell document 1
set bxCount to count of text box
try
set theResult to ¬
display dialog "Document Text Box Count: " & bxCount ¬
buttons {"Reveal", "Hide", "Cancel"} ¬
default button 1 with icon note
-- user pressed Cancel
on error number -128
return
end try
if button returned of theResult is "Reveal" then
set bxProp to {stroke type:short dash, stroke color:bxBlue}
else if button returned of theResult is "Hide" then
set bxProp to {stroke type:none}
end if
repeat with next from 1 to bxCount
tell text box next
set properties to bxProp
end tell
end repeat
end tell
end tell