Hi all,
A short while ago I posted here asking for advice on how to analyze a captured
clip in order to anaylze it as a vector and to remove certain lines. Sheri gave
some great assistance and I have been playing with the script for a bit but
still cannot get the results I am looking for. I would like to remain the lines
in the test block in the same order, and all lines containing "Trigger2"
removed from the vector. Then the vector should be saved and put back on the
clipboard.
See below script to start with :
; ============================================================
win.resetfocus()
local mycliphan = win.getfocus
local i
local mycaption
local myclip = clip.get
local v = vec.createFromLines(myclip)
local len = v.length
; ============================================================
; Check if clip taken on Notepad
; ************************************
if (win.exename(mycliphan)=="notepad") do
mycaption=win.caption(window("firstwindow", "c=notepad"))
if (find(mycaption, "untitled") > -1) do
; approach 1
; ==========
for each line varline in v
if (find(varline,"Trigger2") > -1)
varline=""
endfor
; approach 2
; ==========
;for (i=len-1;i<0;i--)
; if (find(v[i],"Trigger2") > -1)
; v.delete(i)
;endfor
endif
wait.for (100)
clip.set (v.makelines)
wait.for (100)
v.showmenu
endif
; ============================================================
The test data is below and captured on a notepad page :
Line1aaobdofig Trigger1 dfgwewertrwet 175218
Line2fsdfsdf23 Trigger2 dtwertthrweth 023203
Line3aaobdofig Trigger3 dfgwererteth3 023302
Line4aaoqwef4g Trigger4 dsdfgsdfgfgrw 041411
Line5aawerr324 Trigger5 dfgwerthrweth 041803
; ============================================================
Any help is highly appreciated.
Cheers