Source language: Translate to:

Select in a text entry

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Select in a text entry

Postby Alex » Sun Apr 27, 2008 10:43 pm

Hi,

Does any body know how to select text in a TextEntry ? Like CTRL+A

Thanks


Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Wrangler » Mon Apr 28, 2008 7:47 am

Try setobjectfocus.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby Alex » Mon Apr 28, 2008 1:36 pm

Hi Wrangler,

Thanks for the replie, I tried
Code: Select all
FocusObject "TextEntry1"
hpwSendKeysToTitle "[pubtitle]" "[#252]A[#253]"


But it doesn't work.

Thanks


Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Wrangler » Mon Apr 28, 2008 1:50 pm

FocusObject "TextEntry1"

This will select all the text in textentry1. What is it you want to do with it after it is selected? Copy it to the clipboard?

SendKeys "" "{CtrlDn}c{CtrlUp}"

Then paste from clipboard:

SendKeys "" "{CtrlDn}v{CtrlUp}"

If you want to paste it into another text object, focus that object before.

What is this supposed to do?
hpwSendKeysToTitle "[pubtitle]" "[#252]A[#253]"
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby domino » Mon Apr 28, 2008 2:46 pm

Mmmm... NB's Send Keys CTR+V works in a text entry box... but as Alex has stated CTRL+A doesn`t.

(Probably not relevant but I`m using a Vista machine)
User avatar
domino
 
Posts: 275
Joined: Sat Apr 02, 2005 7:11 am
Location: Notts UK

Postby Gaev » Mon Apr 28, 2008 3:36 pm

domino:
Mmmm... NB's Send Keys CTR+V works in a text entry box... but as Alex has stated CTRL+A doesn`t.
Ctrl+A also doesn't work in the IE Address Box (also a TextEntry Box) ... when you first click inside this Box, IE selects the entire content ... but try clicking again (to deselect the content) and typing Ctrl+A ... nothing ... ditto for other TextEntry Boxes (e.g. in NeoBook's Dialog Boxes in Design Mode).

However, you can select entire content of a TextEntry Box by ...

a) Ctrl+Home ... to make sure insertion point is at start of content

b) Ctrl+Shift+End ... to select everything till the end of the content

... and you can ask NeoBook to do it for you with ...
Code: Select all
FocusObject "TextEntry1"
SendKeys "" "{CtrlDn}{Home}{CtrlUp}{CtrlDn}{ShiftDn}{End}{ShiftUp}{CtrlUp}"
User avatar
Gaev
 
Posts: 3738
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Alex » Tue Apr 29, 2008 3:51 am

Hi Gaev,

Thank you very much, it works perfect.
Thank you domino and Wrangler for your replie.



Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Odd » Sun Nov 29, 2009 12:00 pm

Gaev wrote:
Code: Select all
FocusObject "TextEntry1"
SendKeys "" "{CtrlDn}{Home}{CtrlUp}{CtrlDn}{ShiftDn}{End}{ShiftUp}{CtrlUp}"

I'm sorry to say this does not work under MS Vista Home Premium OS Service Pack 2, when I try this. Any suggestions? This is my code:
Code: Select all
SubStr "[TextEntry_Emne]" "1" "16" "[emne1]"
IfEx "('[TextEntry_Emne]' <> '') AND ('[emne1]' <> 'Overskriften[#32]her')"
FocusObject "TextEntry_Ide"
Else
FocusObject "TextEntry_Emne"
SendKeys "" "{CtrlDn}{Home}{CtrlUp}{CtrlDn}{ShiftDn}{End}{ShiftUp}{CtrlUp}"
EndIf
User avatar
Odd
 
Posts: 81
Joined: Sat Apr 02, 2005 3:34 am
Location: Norway

Postby Wrangler » Sun Nov 29, 2009 12:09 pm

Hi Odd,

Try this:

SendKeys "" "{CtrlDn}{ShiftDn}{Home}{CtrlUp}{ShiftUp}"
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby Odd » Sun Nov 29, 2009 1:24 pm

Thank you, Wrangler.

But no, this doesn't do the trick either. The text is not selected (highlighted) and the cursor is left at the end of the text. It seems NeoBook disregards (?) the command all together...
User avatar
Odd
 
Posts: 81
Joined: Sat Apr 02, 2005 3:34 am
Location: Norway

Postby Wrangler » Sun Nov 29, 2009 1:31 pm

Hmmm. Guess we'll have to leave this one for Dave to answer. I don't have Vista installed, so I can't test it.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby Gaev » Sun Nov 29, 2009 1:34 pm

Odd:
I'm sorry to say this does not work under MS Vista Home Premium OS Service Pack 2, when I try this.

a) There can be gazillion different behaviours that qualify as "does not work" ... perhaps you can describe what "did happen" or "did not happen as expected".

b) In order to investigate how Vista is different from the other operating environments, you should try and do an experiment (in a separate pub) with a simple setup of a Text Entry Box and a Button that invokes the code to select the text in the Text Entry Box ... that way you know that it is not the other If/Else code that is being triggered.

c) using this experimental pub, check out manually (i.e. using your fingers on the keyboard) which key combinations cause the text to be selected ... does Ctrl+Home cause the insertion point to move to the beginning of the text ? ... then does Ctrl+Shift+End cause it to be selected ?

If (c) works and (b) does not, then it might be that SendKeys does not work properly in the Vista emvironment ... otherwise, you have to find the key combinations for causing text in Text Entry Boxes to be selected ... Ctrl+A maybe ?

In your experimental pub you can also setup Buttons for {Left} and {Right} ... see if it works in Vista.
User avatar
Gaev
 
Posts: 3738
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Odd » Mon Nov 30, 2009 2:37 am

Thank you for your kind suggestions, both Wrangler and Gaev.

a) Nothing (regarding my SendKeys action) happened as expected :wink:

b) Of course I will, but in the debugger, the send key line is executed.

c) Yes to both questions. Also the easiest way to do this manually, is Shift+Home, as the cursor is positioned after the heading text, as it is filled by my script (see above) to "Overskriften[#32]her" (meaning "Heading goes here").

Yes c works and b doesn't. I'll try Ctrl+A.

I have also tried {Left} and {Right} with same result, i.e. nothing happens. So it seems Vista doesn't co-work with SendKeys at all. Perhaps I will have to try with mouse positioning...
User avatar
Odd
 
Posts: 81
Joined: Sat Apr 02, 2005 3:34 am
Location: Norway

Postby Neosoft Support » Mon Nov 30, 2009 12:22 pm

The following seems to correctly highlight text on my Vista PC:

FocusObject "TextEntry1"
SendKeys "" "{CtrlDn}A{CtrlUp}"
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby Odd » Wed Dec 02, 2009 6:26 am

Ctrl+A worked properly in the page enter section, but not within the action button. I had to put it there for the opening script and make a subroutine for other instances, and now it seems to work. Thank you!

But why the SendKeys don't work in a button, is a puzzle beyond me... :oops:
User avatar
Odd
 
Posts: 81
Joined: Sat Apr 02, 2005 3:34 am
Location: Norway

Next

Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 2 guests