PDA

View Full Version : Grab text from an application window




wrldwzrd89
Jan 6, 2006, 09:06 PM
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.



superbovine
Jan 8, 2006, 03:23 PM
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.

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.

wrldwzrd89
Jan 9, 2006, 09:25 AM
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.
Thanks, somehow when I was looking through Automator I missed that completely.