Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Aouttier

macrumors member
Original poster
Mar 3, 2016
42
0
Belgium
I'm trying to write an AppleScript to delete a certain paragraph in a Pages document, which has the font color "red".

My working script is:
Code:
tell application "Pages"
    tell the front document
        tell the body text
            delete (every paragraph where its size is 11)
        end tell
    end tell
end tell

But when I change the section based on the size of the font to the color of the font, it doesn't work anymore.

My unworking script is:
Code:
tell application "Pages"
    tell the front document
        tell the body text
            delete (every paragraph where its color is "red")
        end tell
    end tell
end tell
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.