Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Delete part of String that reads "(????)
#1
Hi,

I'm using the code below to paste some text into a field and if the text string contains the text (Easy) it performs a certain action action and then returns to the first field and deletes the last 6 letters to remove (Easy) as this is always at the end.

The problem I have is that the text string looks like this..

Name (????) (Easy)

The code below also copies the ???? to another field, however I can't find a way of then deleting " (????)" from the first field.

I have tried going back to the first field and selecting the text, then copying it to the clipboard. So at this point, is there any code I can run to delete the " (????)" part of the text?

Here is my code so far.

Code:
Copy      Help
int w1=act(win("Window A" "IEFrame"))
lef+ 1105 593 w1
lef- 372 593 w1
'Cc
'AT
int w2=act(win("Window B" "IEFrame"))
lef 199 399 w2
'Cv
sel _s.getclip 3
    case "*(Easy)*"
    out "yes"
    'BBBBBBBB
    'SH Cc
    'TTTy
    case else
    out "no"
    'SH Cc
    'TTTn
str s
s.getclip ;;makes s equal to what's in the clipboard.
s.setclip ;;makes the clipboard equal to what s is.
str s2
if(findrx(s "^.+ \((.+)\)$" 0 0 s2 1)>=0)
    out s2
    s2.setclip ;;makes the clipboard equal to what s is.
    lef 206 498 w2
    'Cv


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)