This script changes the style on the last paragraph in the document to "Normal." And using Quicksilver to trigger the applescript with a keystroke, that gets me halfway to where I want to be. But half the time I'm editing in the middle of a document.
My question is, how do I change this script so that it will apply to the current paragraph I'm tying in? The answer might be right in front of my face; I'm new to Applescript.
Try this:
tell document 1 of application "Pages" set theSelection to selection set paragraph style of theSelection to paragraph style "Normal" end tell
It makes use of the selection property of the document. Note that it returns a reference, so you have to stick it into a variable as above in order for it to be evalutated properly.
In addition, setting the paragraph style of any text selection will affect all paragraphs that intersect the selection -- you don't have to select the entire paragraph. |