PDA

View Full Version : applescript - recognizing selected text in Pages




acevh3
Aug 1, 2009, 03:29 AM
Here is a simple applescript that will modify all the paragraphs in a Pages document to have a "space after" setting of 4:

tell front document of application "Pages"
set space after to 4
end tell

What I really want is to pre-select only certain paragraphs, then run the script and have it act only on those paragraphs. How can I make it act only on the selected text?
Thanks for any suggestions.



mysterytramp
Aug 1, 2009, 07:19 AM
I've done just some quick testing, but this seems to work:

tell application "Pages"
get the selection
set space after of the result to 14.0
end tell


mt