...

View Full Version : javascript:Copy the selected text to notepad automatically



jmohan
08-21-2008, 09:24 AM
Hi everyone,

I need to copy the selected text(in website) to Notepad automatically. The details as follows:

(1) I select the particular paragraph or sentence or word in the website.

(2) Then, I press the Ctrl+C

(3) When, I open the Notepad or msword or wordpad, the copied text need to pasted in the notepad or msword or wordpad automatically. I need the javascript to do this.
please help me.

Thanks in Advance,

J. Mohan

rnd me
08-21-2008, 09:34 AM
you cannot control notepad or word with javascript.

the best you can do is merely get the text on the clipboard, and even that requires browser-specific routines, and security config changes.

chaosprime
08-21-2008, 09:50 AM
The closest you're going to be able to do to that is triggering a download of a text/plain document, which the user may have the option of opening in notepad or whatever, according to how their browser is configured to handle those.

jmohan
08-22-2008, 05:44 AM
you cannot control notepad or word with javascript.

the best you can do is merely get the text on the clipboard, and even that requires browser-specific routines, and security config changes.

thanks for your reply,

ok, How can I transfer the copied text(website) to Clipboard using Javascript.
Then, How to transfer the clipboard to Notepad.

jmohan
08-22-2008, 05:46 AM
how to transfer the selected text to clipboard, then how to transfer the clipboard data to notepad.

thanks for your reply,

J. Mohan

rnd me
08-22-2008, 07:18 AM
i have some code for firefox and ie, but like i said, you will need security changes to use it.


is this just for something you are working on, or is this for a public site that lots of strangers use?

the code wouldn't be much good in the second scenario.

Philip M
08-22-2008, 07:26 AM
You will find an IE-only solution here:-

http://www.htmlgoodies.com/beyond/javascript/article.php/3458851

I have the idea that no clipboard script will work in Firefox or Mozilla unless
- you make a signed script
- the user has changed the security settings on the browser.


All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

jmohan
08-26-2008, 07:30 AM
You will find an IE-only solution here:-

http://www.htmlgoodies.com/beyond/javascript/article.php/3458851

I have the idea that no clipboard script will work in Firefox or Mozilla unless
- you make a signed script
- the user has changed the security settings on the browser.


All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

ok , I have found the solution to transfer the data to clipboard as follows:


var mIE= document.selection.createRange();

mIE.execCommand("Copy");

Now, I need to transfer the clipboard data to notepad using javascript. How?

J.Mohan.

Philip M
08-26-2008, 07:38 AM
Now, I need to transfer the clipboard data to notepad using javascript. How?


Not possible.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum