• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Change styles in Pages 2.0 - Apply to Current Paragraph?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Change styles in Pages 2.0 - Apply to Current Paragraph?


  • Subject: Re: Change styles in Pages 2.0 - Apply to Current Paragraph?
  • From: Scott Lindsey <email@hidden>
  • Date: Tue, 31 Jan 2006 13:29:05 -0800

From: Wes Brown <email@hidden>

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.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Choosing files
  • Next by Date: Script needed: When a file or folder is added to a drop box, an alias to the file is created in another folder...
  • Previous by thread: Change styles in Pages 2.0 - Apply to Current Paragraph?
  • Next by thread: Choosing files
  • Index(es):
    • Date
    • Thread