Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

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

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

2 Answers 2

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

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

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.

share|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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.