Highlighting Characters Until...

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
jamie

Highlighting Characters Until...

Post by jamie » Sat May 03, 2003 1:55 pm

Hello I am trying to write a script that will hold down shift and press the right arrow key until it reaches a space.

For example if the word apple is there, the script will select everything up until the end of the word and when it reaches the space stop and copy that value into the clipboard without the space.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sat May 03, 2003 6:09 pm

Different programs have different tools to do things like that. Regular Expresssions or RegEx may also be helpful.

What program are you trying to do that in?

Also see if that program supports Regular Expressions or another language that supports Regular Expressions.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Steve

Highlighting Characters

Post by Steve » Wed May 07, 2003 11:04 am

Hi Jamie,

Sounds like you need to do some pattern mathing and string functions

read your text into a variable e.g. line then look for the pattern
Let>n=1
MidStr>%line%,n,5,text
if text=apple then get the preceeding text from the line
using
midstring>%line%,1,n-1,text2
The variable text2 now holds the text before the A of apple

Hope this helps

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts