Applescript to select every other word?

Discussion in 'macOS' started by ero87, May 9, 2008.

  1. ero87 macrumors 65816

    ero87

    Joined:
    Jan 17, 2006
    Location:
    New York City
    #1
    Hi friends,

    I was wondering if someone could do me a favor... I need an applescript that will select every other word in a block of text in Pages. i.e., it would select words 1, 3, 5, 7, etc. I then plan to change these words the color blue. I can go through this manually, but it will take forever. Is this kind of script possible?

    Thanks so much for any help you can give! :)
     
  2. ero87 thread starter macrumors 65816

    ero87

    Joined:
    Jan 17, 2006
    Location:
    New York City
  3. WilWheaton macrumors member

    Joined:
    Feb 21, 2008
    #3
    This subroutine should do the trick for determining if an integer is odd or not, I'll leave someone else to complete the entire function though or try to do it for you later if I get more time

    Code:
    on is_odd(this_number)
     if this_number mod 2 is not 0 then
     return true
     else
     return false
     end if
    end is_odd
     

Share This Page