Následující kód ulozte do souboru ve slozce PSPADU:
.\Script\VBScript\SameLineStart.vbs

V nastavení programu / System 
povolte skriptování, pokud není

Nově v menu skript by se měla objevit položka Same line start s klávesovou
zkratkou Alt+F. Jméno i zkratku si upravte dle libosti v posledním řádku
skriptu.

Skript hledá a porovnává text na začátku řádku před dvojtečkou

' it will renumber all pictures from 01...
' sample source:
'... <img alt="01" src="../Images/01.jpg"/></p> ...
const module_name  = "LinesSameStart"         'this name must be unique !!!
const module_desc  = "Find lines with same start"  'script description
const module_ver   = "1.00"         'version

sub SLS
  set obj1 = newEditor()        'new editor object
  obj1.assignActiveEditor()     'assign active editor
  dim s
  dim s1
  dim y 
  y = obj1.CaretY   'start line
  obj1.CaretY(y)                'set cursor to line number i
  s1 = Split(obj1.lineText(), ":")(0)   'read line content to variable
  for i = y + 1 to obj1.linesCount()  'go through lines in editor
      obj1.CaretY(i)            'set cursor to line number i
      s = Split(obj1.lineText(), ":")(0)        'read line content to variable
                if s1 = s then
                  exit for
                else
                  s1 = s
                end if
  next
end sub

' name "Init" is required, its called automatically during initialization to
create menu items
sub Init
  addMenuItem "Same line start","", "SLS", "Alt+F"
end sub


-- 
<https://forum.pspad.com/read.php?1,79589,79595>
PSPad freeware editor https://www.pspad.com

Odpovedet emailem