Loading ...
Sorry, an error occurred while loading the content.

24189Simple search and replace

Expand Messages
  • Mike Breiding - Morgantown WV
    Nov 26, 2013
    • 0 Attachment
      I am using the following clip with a added search and replace at the
      I get an error when I run the clip.
      What do I need to do to fix this?
      I want to:
      Find: jpg"><img
      Replace php"><img

      ;This Clip will create a web page based on all the images that match the
      specified criteria. You can then easily preview all the images in your
      favorite browser

      ;Prompt user with Clip wizard to determine which image files should be
      listed and how the page should be built
      ^!Set %PageTitle%=^?{Page title=TITLE GOES HERE}; %FileName%=^?{Web page
      file name (no path or extension)=index}; %Directory%=^?{(T=D)Directory
      to search}; %Specs%=^?{File Specs=*.jpg}; %Sorting%=^?{(T=C)File
      sorting==Unsorted|_Name|Type|Date|Size}; %Reverse%=^?{(T=C)Descending
      ;End procedure if the user canceled the Clip wizard
      ^!IfCancel Exit

      ^!SetPasteIndent Off
      ;Set variable for sorting parameter
      ^!Set %Sorting%=^%Reverse%^%Sorting%
      ;Close the output file if there is one open in NoteTab
      ^!Close "^%Directory%^%FileName%.html"
      ;Create a new document with specified name for web page
      ^!Set %KeepNameFormat%=^$GetNameFormat$
      ^!SetNameFormat ^%Directory%^%FileName%.html
      ^!ToolBar New Document
      ^!SetNameFormat ^%KeepNameFormat%
      ;Turn word wrap off
      ^!SetWordWrap OFF

      ;Retrieve first image name that matches specified search criteria
      ^!Set %ImageFullName%=^$GetFileFirst(^%Directory%;"^%Specs%";^%Sorting%)$
      ;If the image name is empty (no more matching files), leave the loop
      ^!IfTrue ^$IsEmpty(^%ImageFullName%)$ ExitLoop
      ;Copy image name without path to variable
      ^!Set %ImageName%=^$GetFileName(^%ImageFullName%)$
      ;Copy image width and height information into variables
      ^!Set %ImgWidth%=^$GetImgWidth(^%ImageFullName%)$;

      ^!InsertHtml <a id="^%imagename%"> </a>^p

      ;Insert image tag and information into document
      ;now includes to high res images
      ^!InsertHtml <a href="hres/^%imagename%"><img src="^%imagename%"
      width="^%ImgWidth%" height="^%ImgHeight%" title="Click for larger image"
      alt="Click for larger image" /></a>^p<p>^%ImageName% </p>^P^p^P^p

      ;Get next matching image name and go back to start of loop
      ^!Set %ImageFullName%=^$GetFileNext$
      ^!GoTo StartLoop

      ^!Replace 'jpg"><img' 'php"><img'
      ;Close the file-find variable to restore system resources

      This email is free from viruses and malware because avast! Antivirus protection is active.
    • Show all 4 messages in this topic