forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Getting selected text into a variable without using Copy?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Thu Dec 02, 2004 4:15 am    Post subject: Getting selected text into a variable without using Copy? Reply with quote

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
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Thu Dec 02, 2004 1:08 pm    Post subject: Reply with quote

hi boo,

would @WINTEXT() be of any use?

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Thu Dec 02, 2004 5:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Thu Dec 02, 2004 5:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Thu Dec 02, 2004 5:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Thu Dec 02, 2004 11:32 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Thu Dec 02, 2004 11:34 pm    Post subject: Reply with quote

Hi Serge,

Yeppers. But what if you only want to extract one or two specific words on the fly?

Cheers,

- Boo
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Thu Dec 02, 2004 11:49 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Fri Dec 03, 2004 2:24 am    Post subject: Reply with quote

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. Smile

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Fri Dec 03, 2004 3:34 am    Post subject: Reply with quote

Here's the JavaScript. Don't know if this is what you need or want, but
here it is none the less Smile.

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 Smile

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Fri Dec 03, 2004 2:10 pm    Post subject: Reply with quote

Darn! I just can't get all the work done for Gadget fast enough Sad
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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Fri Dec 03, 2004 2:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Fri Dec 03, 2004 2:59 pm    Post subject: Reply with quote

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 Wink

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Fri Dec 03, 2004 3:02 pm    Post subject: Reply with quote

Cool!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group