I want to copy highlighted text from a certain site into an output folder on my Desktop. I know there are scripts that can copy highlighted text via JavaScript but I've only seen them for copying highlighted text on the particular website where your JavaScript is being executed.

Say I highlighted text from google.com... is there a way to run a script from my terminal and have that text copied and pasted into a folder that I specify on my Desktop?

link|improve this question
feedback

migrated from stackoverflow.com May 24 '11 at 6:04

This question came from our site for professional and enthusiast programmers.

2 Answers

Nah unless you overwrite the "highlight" event in your browser's code.

link|improve this answer
And im assuming that's probably a pain in the ass? – Anonymous May 24 '11 at 1:58
feedback

You can execute javascript directly through the address bar in your browser by typing "javascript:" and then the code. That would work on any website and it should run with enough rights to create files etc.

link|improve this answer
Not true. JavaScript executed in the address bar runs in the page currently being viewed. Content pages and JavaScript URIs cannot access local files. – Anonymous May 22 '11 at 22:23
feedback

Your Answer

 
or
required, but never shown