I am new to almost everything under the sun, especially if it is scripting

I am using an iMacro which pastes text in a text area. I want to know how I could make the iMacro to delete the last word of the pasted text.
Thanx
Max
Code: Select all
' Extract the content of the text area
TAG POS=1 TYPE=TEXTAREA FORM=ID:postform ATTR=ID:message EXTRACT=TXT
' Lenght of the last word + the space before it
SET !VAR1 EVAL("var e=\"{{!EXTRACT}}\"; (e.toString().length - e.toString().lastIndexOf(\" \"));")
' Prepare the good numbers of delete for the keypress command
SET !VAR2 EVAL("var t=\"\"; for(i=0; i<=parseInt(\"{{!VAR1}}\"); i++){t+=\"8,\"};t=t.substring(0, t.length-1);")
' Delete the last word and the space before it
EVENTS TYPE=KEYPRESS SELECTOR="#message" KEYS="[{{!VAR2}}]"
ERN645 wrote: ↑Tue Aug 27, 2019 3:01 pmMaybe know how need delete space from this code.
When i extraxt number i got numbers with space
space is before numbers, maybe can make fix problem
Code: Select all
VERSION BUILD=1005 RECORDER=CR SET !EXTRACT_TEST_POPUP NO TAG XPATH="//*[@id="a-page"]/div[3]/div[1]/div/div/div/div/div[1]/h5" EXTRACT=TXT SET !VAR1 EVAL("var variable=\"{{!EXTRACT}}\"; variable.replace(/Order Number:/g,''); ") WAIT SECONDS=3 TAB CLOSE WAIT SECONDS=3 TAG SELECTOR="#modal_buy_order_id" CONTENT={{!VAR1}} TAG SELECTOR="#modal-6>DIV>DIV>DIV:nth-of-type(2)>DIV:nth-of-type(7)>DIV>DIV" TAG POS=1 TYPE=BUTTON ATTR=ID:save_order_changes TAG POS=1 TYPE=BUTTON ATTR=TXT:Change<SP>Details
Code: Select all
SET !VAR1 EVAL("var variable=\"{{!EXTRACT}}\"; variable.replace(/Order Number: /g,''); ")
ERN645 wrote: ↑Tue Aug 27, 2019 4:21 pmMaybe you can help and write code for me please,
i try but all time got errror , i try many metods
for me i got resilt
but i want to make like it but with out scpase before numbersCode: Select all
123-54125478445
Code: Select all
123-54125478445