applescript - recognizing selected text in Pages

Discussion in 'Mac Programming' started by acevh3, Aug 1, 2009.

  1. acevh3 macrumors newbie

    Joined:
    Aug 1, 2009
    #1
    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.
     
  2. mysterytramp macrumors 65816

    mysterytramp

    Joined:
    Jul 17, 2008
    Location:
    Maryland
    #2
    I've done just some quick testing, but this seems to work:

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

Share This Page