Zde je skript, ktery precisluje obrazky podle poradi
Ve slozce PSPad\Script\VBScript vytvorit novy soubor, treba precisluj.vbs a do
nej ulozit nasledujici obsah (vyhodte pripadne prazdne radky). V menu script
(pokud menu neni, tak povolit skriptovani v nastaveni programu / Integrace do
systemu) zavolat rekompilaci skriptu (vola se automaticky pri spusteni) a v menu
Skript by se mel objevit radek: Precislovanie obrazkov
Kdyz jej spustite, mel by precislovat ALT i cislo obrazku
Hleda a nahrazuje: <img alt="01" src="../Images/01.jpg
Pokud to mate jinak, je treba upravit regularni vyraz


' it will renumber all picturest
const module_name  = "Precislovanie" 
const module_desc  = "Precislovanie obrazkov" 
const module_ver   = "1.00"

sub Precisluj
  PictNum = 1
  PictStr = ""
  StrToFind = "<img alt=" & Chr(34)   ' hledame <img alt="

  Set re = New RegExp
  ' <p style="text-align: center;"><img alt="01" src="../Images/01.jpg"/></p>
  re.Pattern = "(<img alt=.)(\d+)(. src=.\.\./Images/)(\d+)(\.jpg)"
  re.Global  = False
  re.IgnoreCase = True
  msgbox re.Pattern
  set obj1 = newEditor()           'new editor object
  obj1.assignActiveEditor()
  dim s
  s = ""
  for i = 1 to obj1.linesCount()
      obj1.CaretY(i)
      s = obj1.lineText()
      PictStr = Right("00" & PictNum, 2)
      if re.Test(s) then
        s = re.Replace(s, "$1" & PictStr & "$3" & PictStr & "$5")
        obj1.lineText(s)
        PictNum = PictNum + 1
      end if
  next
end sub

' name "Init" is required, its called automatically during initialization to
create menu items
sub Init
  addMenuItem "Precislovanie obrazkov", "", "Precisluj"
end sub


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

Odpovedet emailem