| View previous topic :: View next topic |
| Author |
Message |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Thu Dec 02, 2004 4:15 am Post subject: Getting selected text into a variable without using Copy? |
|
|
Hi All,
Is there a way to select text within a non-VDS application, and then "grab" the text into a variable, without using the Copy or Cut commands?
For example... A user selects (highlights) an e-mail address on a Web page. How can the e-mail address be added to a variable without use of the Copy command?
Note: Is there a way to accomplish this WITHOUT having to use the Windows clipboard? I need a way to avoid having to do this...
Thanks,
- Boo |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Thu Dec 02, 2004 1:08 pm Post subject: |
|
|
hi boo,
would @WINTEXT() be of any use?
serge _________________
|
|
| Back to top |
|
 |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Thu Dec 02, 2004 5:01 pm Post subject: |
|
|
Hi Serge,
Thanks, but nopers. The function @wintext() can be used to pull a windows title (and text in certain controls here and there), but I have not been able to retrieve ONLY selected text from non-VDS controls (such as selected text on a Web page)...
Any ideas?
Thanks,
- Boo |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Thu Dec 02, 2004 5:24 pm Post subject: |
|
|
Is there a reason you wish not to use the clipboard?
-Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Thu Dec 02, 2004 5:28 pm Post subject: |
|
|
Yeppers. I need to keep the clipboard intact (which may be holding important binary information).
I can always grab the contents of the clipboard, then use the clipboard temporarily, then replace the original contents. Problem is, I cannot grab and replace binary information (such as copied files)... Only works with text...
Perhaps I should play around with an in/out solution... |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Thu Dec 02, 2004 11:32 pm Post subject: |
|
|
what i do to get text from a web page is download the web page using vdsbrw.dll and then place the contents into a list and then extract the information i need from there
serge _________________
|
|
| Back to top |
|
 |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Thu Dec 02, 2004 11:34 pm Post subject: |
|
|
Hi Serge,
Yeppers. But what if you only want to extract one or two specific words on the fly?
Cheers,
- Boo |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Thu Dec 02, 2004 11:49 pm Post subject: |
|
|
you'd have to download the page every time you wanted to get info from it
even if you don't use this method, you would still need to download the page somewhere before getting information from it
serge _________________
|
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Fri Dec 03, 2004 2:24 am Post subject: |
|
|
I only know of one way to do what you are referring to, and that is with
JavaScript. Can probably be done with VBScript also. I will see if I can find
the script that I have and I'll post it here.  _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Fri Dec 03, 2004 3:34 am Post subject: |
|
|
Here's the JavaScript. Don't know if this is what you need or want, but
here it is none the less .
| Code: |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="Generator" CONTENT="TextPad 4.4">
<LINK href="general.css" rel="stylesheet" type="text/css">
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Ronnie T. Moore -->
<!-- Web Site: The JavaScript Source -->
<!-- Begin
var text = "";
function getActiveText(e) {
// Sets text MSIE or Netscape active
// text based on browser, puts text in form
text = (document.all) ? document.selection.createRange().text : document.getSelection();
document.theform.text.value = text;
return true;
}
document.onmouseup = getActiveText;
if (!document.all) document.captureEvents(Event.MOUSEUP);
// End -->
</script>
</HEAD>
<BODY Background=../graphics/grayback.jpg>
<center><BR><BR>Try highlighting some of this text.<BR><br>
<form name=theform>
Selected text: <input type=text name=text value="">
</form>
</center>
</BODY>
</HTML>
|
Save the above code as a HTML file and check it out with IE or Netscape  _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Fri Dec 03, 2004 2:10 pm Post subject: |
|
|
Darn! I just can't get all the work done for Gadget fast enough
Boo, the new version of Gadget can do this because it has ActiveX abilities. If you know Visual Basic or JavaScript and VDS you would be able to do exactly what Bill's JavaScript above does with very little changes. I have to get the documentation written and I have to finish all these examples for Gadget before I can even start on the website.
Also I have been having issues with ActiveX events since VDS is single threaded and stops at every line of code until that line is through. This means that while VDS is processing the one line of code nothing else happens. VDS events do not fire. I have been successful at firing API callbacks as VDS events but then you don't get the return value of the initial API call. Anyway I am trying to use this same method for Gadget's ActiveX events if successful you will only have to change syntax for most Visual Basic and JavaScript AcitveX code. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
jwfv Valued Contributor

Joined: 19 Mar 2002 Posts: 422 Location: Beaufort, SC
|
Posted: Fri Dec 03, 2004 2:46 pm Post subject: |
|
|
Sounds great! This would be a solution for my problem that you responded to about the Microsoft Office 2003 OCR component! (other thread) _________________ Joe Floyd |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Fri Dec 03, 2004 2:59 pm Post subject: |
|
|
| jwfv wrote: | | Sounds great! This would be a solution for my problem that you responded to about the Microsoft Office 2003 OCR component! (other thread) |
Joe I have this working. I need to corespond with you about it Via PM. I am working on the documentation now so you will know what you are looking at  _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Fri Dec 03, 2004 3:02 pm Post subject: |
|
|
| Cool! |
|
| Back to top |
|
 |
|