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

Clip File&Folder Ops

Expand Messages
  • junja
    File&Folder-Ops is a clip for carrying out operations on the file currently loaded and/or its folder. It was developed under Windows 98se and NoteTab v 4.95,
    Message 1 of 1 , Jan 20, 2007
      File&Folder-Ops is a clip for carrying out operations on the
      file currently loaded and/or its folder. It was developed
      under Windows 98se and NoteTab v 4.95, has been used under
      Windows 2k & Xp.

      Much of its purpose is with `mirror' disks - zips, usb keys,
      hard disks - holding the same folder structure as the
      current disk.

      The operations are:
      - for the folder: Explore it, Salam it,
      - for the file: Open it in Notepad2, Write it to A:\ or to
      its mirror folder on another disk (without then loading it
      in place of the original), View or Filter it using Xvi32.

      When an operation requires a second, target, disk and the
      clip asks for one, it's expecting to find the same folder on
      the mirror - if the current file is
      d:\docs\examples\example.txt, it'll expect to find the
      folder \docs\examples\, or create/copy the file
      \docs\examples\example.txt, on whatever disk you choose.

      The software used:
      - Servant Salamander 1.52 is a double-pane file explorer.
      - Notepad2 is a text editor (which I sometimes use for
      correcting mistakes in outline files)
      - Xvi32 is a binary file editor which allows scripting - so
      filtering out end-of-file characters or swapping between
      windows/mac/linux line endings or converting from one
      character set to another is child's play.

      The programs are available on the net - if nowhere else, at
      their home pages:
      - Notepad2 - http://www.flos-freeware.ch/notepad2.html
      - Servant Salamander 1.52 -
      http://www.altap.cz/download.html#salrel
      - Xvi32 -
      http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm

      I've left some debugging code in the clip - which may be
      useful for anyone who wants to modify it.
      Two of the programs are in c:\programs\ on my system - if
      not on yours, the path needs altering accordingly.
      junja

      ;;; the code
      ;;; select & copy from the line below down to the ":end"
      line ;;;
      H="File&Folder Ops"
      ^!SetWizardLabel Current file/folder ops
      ^!Set %Op%=^?{(H=3)==O - folder, current - actions on |I -
      file, current - actions on |Q - Quit}
      ^!IfFalse ^$IsEmpty(^%Op%)$ Skip_2
      ^!SetWizardLabel Make sure one entry is highlighted
      ^!Goto Skip_-3
      ; ^!Info Op is ^%Op%
      ; ^!Set %Optodo%=^$StrCopyLeft("^%Op%";1)$
      ^!Set %Optodo%=^$StrCopy("^%Op%";1;1)$
      ; ^!Info Optodo is ^%Optodo%
      ^!IfLabelExist ^%Optodo% ^%Optodo% else next
      ^!Info Label Optodo (^%Optodo%) not found (ending)
      ^!Goto end

      ; labels used: o e s i n a x f cf ef lf vf q qf

      ; ------- folder ops

      :O
      ^!SetWizardLabel Current file's folder
      ^!Set %Op%=^?{(H=3)==Explore it|Salam it & its pair|Quit}
      ^!IfFalse ^$IsEmpty(^%Op%)$ Skip_2
      ^!SetWizardLabel Make sure one entry is highlighted
      ^!Goto Skip_-3
      ^!Set %Optodo%=^$StrCopy("^%Op%";1;1)$
      ; ^!Info Optodo is ^%Optodo%
      ^!IfLabelExist ^%Optodo% ^%Optodo% else next
      ^!Info Label Optodo (^%Optodo%) not found (ending)
      ^!Goto end

      :E
      ^!explorer.exe ^$GetPath(^**)$
      ^!Goto end

      :S
      ; Salam current folder & its pair
      ^!Set %Dsk%=^?{(T=L) Second disk: C|D|E|F|G|H|I|J|K}
      ^!Set %2ndPath%=^$GetPath(^**)$
      ^!Set %2ndPath%=^$StrDeleteLeft("^%2ndPath%";1)$
      ^!Continue Salam ^$GetPath(^**)$ ^%dsk%^%2ndPath%
      ^!c:\programs\salam\salamand.exe ^$GetPath(^**)$
      "^%dsk%^%2ndPath%"
      ^!Goto end

      ; ------- file ops

      :I
      ^!SetWizardLabel Current file
      ^!Set %Op%=^?{(H=6)==A - save it to A:\|X - save it to
      X:\path|N - open it in Notepad2|F - filter it with xVi32|Q -
      Quit}
      ^!IfFalse ^$IsEmpty(^%Op%)$ Skip_2
      ^!SetWizardLabel Make sure one entry is highlighted
      ^!Goto Skip_-3
      ^!Set %Optodo%=^$StrCopy("^%Op%";1;1)$
      ; ^!Info Optodo is ^%Optodo%
      ^!IfLabelExist ^%Optodo% ^%Optodo% else next
      ^!Info Label Optodo (^%Optodo%) not found (ending)
      ^!Goto end

      :N
      ^!c:\programs\notepad2.exe ^**
      ; alter the path above if necessary !!!
      ^!Goto end

      :A
      ; o'write file to a:
      ^!Set %FileName%=^$GetDocName$
      ^!Continue Copy ^%FileName% to a: ?
      ^!CopyFile "^%FileName%" "a:\"
      ^!Goto end

      :X
      ; Write current file to its folder pair
      ^!Set %Dsk%=^?{(T=L) Save to Disk: C|D|E|F|G|H|I|J|K}
      ; ^!Info dsk is ^%dsk%
      ^!Set %OldName%=^**
      ^!Set %NewName%=^**
      ^!Set %NewName%=^$StrDeleteLeft("^%NewName%";1)$
      ; ^!Info NewName is now ^%dsk%^%NewName%
      ^!Continue Copy ^%OldName% to ^%dsk%^%NewName% ?
      ^!CopyFile "^%OldName%" "^%dsk%^%NewName%"
      ^!Goto end

      :F
      ^!SetWizardLabel File filter ops
      ^!Set %Op%=^?{(H=5)==Character conversion |Eof |Lf, cr
      etc.|View it|Quit}
      ^!IfFalse ^$IsEmpty(^%Op%)$ Skip_2
      ^!SetWizardLabel Make sure one entry is highlighted
      ^!Goto Skip_-3
      ; ^!Info Op is ^%Op%
      ; ^!Set %Optodo%=^$StrCopyLeft("^%Op%";1)$
      ^!Set %Optodo%=^$StrCopy("^%Op%";1;1)$
      ; ^!Info Optodo is ^%Optodo%
      ^!IfLabelExist ^%Optodo%F ^%Optodo%F else next
      ^!Info Label Optodo+F (^%Optodo%F) not found (ending)
      ^!Goto end

      :CF
      ; ^!Info this is ^%Optodo%F
      ^!SetWizardLabel Which direction
      ^!Set %filta%=^?{(H=3)==DosWin|WinDos|Quit}
      ^!IfLabelExist ^%filta% ^%filta% else next
      ^!Info Label filta (^%filta%) not found (ending)
      ^!Goto end

      :Doswin
      :Windos
      ; ^!Info this is ^%filta%
      ; ^!Info c:\programs\xvi32\xvi32.exe ^**
      /s=c:\programs\xvi32\^%filta%.xct
      ^!c:\programs\xvi32\xvi32.exe ^**
      /s=c:\programs\xvi32\^%filta%.xct
      ^!Goto end

      :EF
      ; ^!Info this is ^%Optodo%F
      ; ^!Info c:\programs\xvi32\xvi32.exe ^**
      /s=c:\programs\xvi32\eof.xsc
      ^!c:\programs\xvi32\xvi32.exe ^** /s=c:\programs\xvi32\eof.xsc
      ^!Goto end

      :VF
      ; ^!Info this is ^%Optodo%F
      ^!c:\programs\xvi32\xvi32.exe ^**
      ; ^!Info ^!c:\programs\xvi32\xvi32.exe ^**
      ^!goto end

      :LF
      ; ^!Info this is ^%Optodo%F
      ^!SetWizardLabel Which operation
      ^!Set %filta%=^?{(H=5)==crlf-cr|crlf-lf|lf-crlf|lflf-lf|Quit}
      ^!IfLabelExist ^%filta% ^%filta% else next
      ^!Info Label filta (^%filta%) not found (ending)
      ^!goto end
      :crlf-cr
      :crlf-lf
      :lf-crlf
      :lflf-lf
      ; ^!Info c:\programs\xvi32\xvi32.exe ^**
      /s=c:\programs\xvi32\^%filta%.xsc
      ^!c:\programs\xvi32\xvi32.exe ^**
      /s=c:\programs\xvi32\^%filta%.xsc
      ; alter the path above if necessary !!!
      ^!Goto end

      :Q
      :QF
      :Quit
      :end
      ;;; Copy down to the line above
      ;;; press f4, right click over a Library
      ;;; Choose "Add from Clipboard"
      ;;; check long lines haven't been split in the mail
      ;;; all lines begin with either ; or ^! or :
    Your message has been successfully submitted and would be delivered to recipients shortly.