Grab text from an application window

Discussion in 'Mac Programming' started by wrldwzrd89, Jan 6, 2006.

  1. wrldwzrd89
    Expand Collapse
    macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #1
    Does anyone know how to do the following in AppleScript:

    Open a web browser
    Select all the text in the current window/tab
    Copy that to the clipboard
    Paste the text into a plain text document
    Save it to a file

    The reason I need plain text is so that command-line programs like grep can read and parse it.
     
  2. superbovine
    Expand Collapse
    macrumors 68030

    superbovine

    Joined:
    Nov 7, 2003
    #2
    there is an pre-configured automator action for Safari called "Get Text from Webpage" there are several others. You might play with that for awhile.
     
  3. wrldwzrd89
    Expand Collapse
    thread starter macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #3
    Thanks, somehow when I was looking through Automator I missed that completely.
     

Share This Page