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

[Clip] Re: clip to automatically decrypt and open zipfile

Expand Messages
  • Jody
    Hi Charles, ... Well, I did not have one done, but have wanted to do it for awhile. So, here it is. I will add it to my FtpZip Library which has more setups
    Message 1 of 8 , Aug 31 11:46 PM
    • 0 Attachment
      Hi Charles,

      > Does anyone have a clip that will open an encrypted zipfile,
      > and then let you automatically close and re-encrypt after
      > editing? (Assuming the file to be edited is a textfile, otl,
      > etc.)
      >
      > No need for anyone to code something new, just wondering if
      > anyone here has done it already and could share it.

      Well, I did not have one done, but have wanted to do it for
      awhile. So, here it is. I will add it to my FtpZip Library
      which has more setups in it making it a bit easier to start
      using. This one is ready to go; just put your winzip path in
      place of mine. Watch out for some very long lines. I tested it
      a number of times and it appears to work fine. cindy says so
      too, so if it doesn't - blame her. :) If you have problems with
      the lines I will zip it up ad upload it tomorrow. nite-all -jody

      <--- Copy below this line --->
      H=Edit Zip Contents...
      ; 09-01-1999, Ntb-Clips@..., Part 1 of 2, jody
      ; one huge line
      ^!Info [L]The Clips below will extract the files of a zip file into a temporary directory in your NoteTab Document folder called Temp~ja. A list will be made of the files and you will be prompted to (an)check the files to open in NoteTab to edit. The tabs can be moved, but do not mix any files opened before or after your files from the zip file in between them. You can switch Libraries while editing, but NoteTab will not remember where it was at if you close the program completely or the Clipbook.^p^pOnce the files are edited they do not need to be saved. Simply click on "Zip'EmUp George" and the edited files will be saved and zipped to the original zip file's location.^p^pMake sure you edit the path that goes to your WinZip where noted in the first Clip.

      ^!ClearVariable %Files%

      ; Sets all the variables used for the script.
      ; change the path to WinZip below to your path. Only
      ; change: F:\WinZip\WinZip32.exe
      ; This is all one long line to the blank.
      ^!Set %p_WinZip%=F:\WinZip\WinZip32.exe; %owrite%=^?{Overwrite files without prompting=_Yes^=-o^%Space%|No^=}; %p_ZipFile%=^?{(1;T=O;F="Zip File|*.zip")Full path and FileName of ZipFile=^$GetDocumentPath$test.zip}^%Space%; %p_Extract%=^?{(2;T=D)Full path of folder to extract to=^$GetDocumentPath$Temp~ja\}; %us%=^?{Check files automatically in file list to edit=_Yes^=_|No^=}

      ; Extracts the files from the zip file. The script waits
      ; till it is done.
      ^!"^%p_WinZip%" -min -e ^%owrite%"^%p_ZipFile%" "^%p_Extract%"
      ^!Wait

      ; Gets the first filename in the temp folder where the
      ; files were extracted.
      ^!Set %Full%=^$GetFileFirst(^$GetDocumentPath$Temp~ja\;*.*)$

      ; Gets the remaining files and appends them all to %Files%.
      ; The ^%us% is set in the first line and adds an underscore
      ; if you choose to have the boxes checked for you.
      :Loop1
      ^!IfTrue ^$IsEmpty(^%Full%)$ DoArray
      ^!Append %Files%=^%us%^%Full%|
      ^!Set %Full%=^$GetFileNext$
      ^!GoTo Loop1

      ; Uses the files from above and makes a checkbox.
      :DoArray
      ^!SetArray %EditList%=^?{(T=A;H=25)Pick=^%Files%}
      ^!Set %p_Count%=^%EditList0%
      ^!Set %Index%=0

      ; Opens the files you checked.
      :Loop2
      ^!SetScreenUpdate Off
      ^!Inc %Index%
      ^!If ^%Index% > ^%p_Count% Info
      ^!Open ^%EditList^%Index%%
      ^!Goto Loop2

      :Info
      ^!SetScreenUpdate On

      ; Sets the doc index number of the last file opened so
      ; the script know where to go back to when closing the files.
      ^!Set %p_DocIndex%=^$GetDocIndex$

      ; A repetitive reminder of what to do next and will happen.
      ; very long line
      ^!Info [L]When you are done editing the files click on "Zip'EmUp George." The files will automatically be saved and zipped up in the location of the zip file you extracted from. Your old zip file will be sent to the recycle bin for backup. The temporary folder and files made will be deleted as well.


      H=Zip'EmUp George
      ; Part II of "Edit Zip Contents..."

      ; Focuses last open document preparing to save and close them
      ^!SetDocIndex ^%p_DocIndex%

      :Loop
      ; Closes the files you opened saving them as it is done.
      ^!SetScreenUpdate Off
      ^!If ^%p_Count% = 0 ZipEmGeorge
      ^!Close Save
      ^!Dec %p_Count%
      ^!Goto Loop

      :ZipEmGeorge
      ; Sends original zip file to the recycle bin
      ^!RecycleFile "^%p_ZipFile%"
      ; Loops till Windows finishes to prevent conflict
      ^!Delay 5
      ^!IfFileExist "^%p_ZipFile%" Skip_-1

      ^!SetScreenUpdate On
      ; Runs Winzip and zips up the edited files including any not edited
      ^!"^%p_WinZip%" -min -a -en "^%p_ZipFile%" "^$GetDocumentPath$Temp~ja\*.*"
      ^!Wait

      ; Deletes temp files
      ^!DeleteFile "^$GetDocumentPath$Temp~ja\*.*"
      ^!RmDir "^$GetDocumentPath$Temp~ja"

      <--- Copy above this line, right --->
      <--- click over the Clipbook and --->
      <--- choose "Add from Clipboard" --->

      Happy Clip'n!
      Jody

      The NoteTab Clip List...
      mailto:Ntb-Clips-Subscribe@...
      mailto:Ntb-Clips-UnSubscribe@...
    • Jody
      Hi Charles, Add the CloseFileFind below the :DoArray label in that clip I just posted. sorry, I forgot about that. ; Uses the files from above and makes a
      Message 2 of 8 , Sep 1, 1999
      • 0 Attachment
        Hi Charles,

        Add the CloseFileFind below the :DoArray label in that clip I
        just posted. sorry, I forgot about that.

        ; Uses the files from above and makes a checkbox.
        :DoArray
        ^!CloseFileFind
        ^!SetArray %EditList%=^?{(T=A;H=25)Pick=^%Files%}

        c ya,
        Jody

        The whole world doth err save you
        and me and even thou doest err some!

        http://www.sureword.com/sojourner
        http://www.sureword.com/mm
      • Charles Cairns
        ... Thanks, Jody! I ll give it a whirl and let you know! --Charles
        Message 3 of 8 , Sep 1, 1999
        • 0 Attachment
          > Well, I did not have one done, but have wanted to do it for
          > awhile...

          Thanks, Jody! I'll give it a whirl and let you know!

          --Charles
        Your message has been successfully submitted and would be delivered to recipients shortly.