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

RE: [Clip] DestroyDoc

Expand Messages
  • Wright, John - Textron Financial
    Whew! Thanks so much for the wealth of information. This clip is now in my library. ... From: hsavage [mailto:hsavage@pobox.com] Sent: Friday, August 08, 2003
    Message 1 of 9 , Aug 8 6:22 AM
      Whew! Thanks so much for the wealth of information. This clip is now in my
      library.

      -----Original Message-----
      From: hsavage [mailto:hsavage@...]
      Sent: Friday, August 08, 2003 4:22 AM
      To: ntb-clips@yahoogroups.com
      Subject: Re: [Clip] DestroyDoc


      Wright, John - Textron Financial wrote:

      > I can't seem to find anything on what I'm trying
      > to do.
      >
      > Anyhow, I'm trying to put a clip together that will prompt for the first
      > part of a document name, then step through my open documents and look for
      > documents with a wildcard and a .rpt or .log suffix. If they are found, I
      > want to 'DestroyDoc' them. For example, prompt for A483AR, then
      destroy any
      > open documents that have names like A483AR*.log or A483AR*.rpt (* is
      > wildcard).
      >
      > ^!DestroyDoc A483AR51.rpt

      John,

      This main clip will do exactly, I think, what you are looking for. I'm
      sending it encoded with a decoding clip, and, in straight text form.

      With the clip wizard you select the path, the second line lets you enter
      a hint of the first few letters of the filenames you're interested in.
      Only files fitting the hint will display in the filelist.

      For instance, your example above, enter in the hint window A483. Only
      files starting with A483 will show in the list. The files may be,
      'A483xyz123.log' or 'A483xyz123.rpt. If you don't enter a hint make sure
      the hint window is clear.

      When you are presented with the filelist just put a checkmark in the box
      for every file you want to ^!DestroyDoc then click .

      hrs

      >--------------------------------------------------
      The first clip is used to decode the second.
      Email wraps long lines which can be difficult to unwrap properly.

      To avoid this the clip is in encoded form with a fixed line length that
      fits nicely into almost any email client without getting wrapped.

      The second form is straight text, you unwrap the long lines to make the
      clip work.

      'To DECODE', the instructions are below.

      Otherwise, you can add the straight clip to a clipbook and manually
      unwrap the email wrapped lines.

      To DECODE:
      Select and copy, all text between markers to new blank document.

      * With the new document;
      * Select and copy the 'UUD kwik' clip, Add to a clipbook.
      * Don't forget to save the clipbook you just added to.
      * The clip newly added clip will appear with the other clips.
      * Place the cursor within the encoded text of the new doc.
      * Run the clip, 'UUD kwik' you added to the clipbook.
      * Encoded text should be decoded without wrapped lines.
      * Select and copy decoded text and Add to a clipbook.

      This main clip, once decoded, added to a clipbook and working, will,
      * let you select a single folder,
      * let you select a single folder and include its subfolders,
      * let you select extensions, .log and .rpt, just .rpt or just .log
      * let you pre-select all files in the folder and subfolders.
      * let you select no files, so you can select them individually.


      ----select copy into a new blank document
      ----from below the begin marker line down to the end marker
      ----don't include either marker in the selection.

      ---- begin marker
      H="UUD kwik"
      ;_Modified~Updated~Created_7/30/03_11:12:16a
      ;_hsavage@...
      ^!Clearvariables
      ^!Set %ww%=^$IsWordWrap$
      ^!SetScreenUpdate 0
      ^!SetWordWrap 0
      ^!SetDebug 0
      ^!Set %ct%=^$DecToChar(164)$^$DecToChar(169)$
      ^!Find "begin 600" TIBSA
      ^!Set %begin%=^$GetRow$
      ^!Find "end" TISA
      ^!Set %end%=^$GetRow$
      ^!Jump LINE_END
      ^!SelectTo ^%begin%:1
      ^!Replace "begin 600^p" >> "begin 600 ^p" TIHSA
      ^!SetCode %text%=^$StrUUDecode(^$StrTrim(^$GetSelection$)$)$
      ^!SetCode %text%=^$StrReplace("^%ct%";"^";^%text%;0;0)$
      ^!SetClipboard ^%text%
      ^!InsertCode ^%text%
      :END
      ^!SetCursor ^%begin%:1
      ^!SetView ^%begin%:1
      ^!SetWordWrap ^%ww%


      H="DELETING .LOG/.RPT FILES"
      begin 600
      MI*DA0VQE87)V87)I86)L97,-"J2I(5-E=%-C<F5E;E5P9&%T92`P#0HZ4U1!
      M4E0-"J2I(5-E=%=I>F%R9%1I=&QE($1E;&5T92!,;V<@06YD(%)P="!&:6QE
      M<PT*I*DA4V5T5VEZ87)D3&%B96P@;&]G(&%N9"!R<'0@1FEL97,@3VYL>2!)
      M;B!&:6QE;&ES="XN+@T*.R!L;VYG(&QI;F4-"J2I(5-E="`E9&5F<&%T:"4]
      MI*D_>RA(/3,R.U0]1"E0:6-K($9I;&4@1F]L9&5R/:2I)$=E=$1O8W5M96YT
      M4&%T:"1].R`E:&EN="4]I*D_>TQE879E($)L86YK(&]R(%1Y<&4@1FEL96YA
      M;64@2&EN="!4;R!,;V]K($9O<CVDJ25E;7!T>25].R`E97AT)3VDJ3][4&EC
      M:R!/<B!4>7!E($EN($9I;&5S5'EP97,@5&\@1&ES<&QA>3U?<G!T("8@;&]G
      M?"HN<G!T?"HN;&]G?3L@)7!L=7,E/:2I/WM3=6)F;VQD97)S/ST]26YC;'5D
      M9:2I/2M\7T5X8VQU9&6DJ3VDJ25E;7!T>25].R`E<V5L96-T)3VDJ3][075T
      M;W-E;&5C="!&:6QE<S\]/5E%4Z2I/5]\7TY/I*D]I*DE96UP='DE?0T*I*DA
      M269386UE(")R<'0@)B!L;V<B("*DJ25E>'0B(*2I(5-E="`E97AT)3TB*BYR
      M<'0[I*DE:&EN="4J+FQO9R(-"CL-"J2I(5-E=$QI<W1$96QI;6ET97(@?*2I
      M)7-E;&5C="4-"J2I(5-E="`E9FEL96QI<W0E/:2I)$=E=$9I;&5S*"*DJ25P
      M;'5S):2I)61E9G!A=&@E(CLBI*DE:&EN="6DJ25E>'0E(CMN86UE*20-"J2I
      M(5-E="`E9FEL96QI<W0E/:2I)%-T<E)E<&QA8V4H(J2I)61E9G!A=&@E(CND
      MJ25E;7!T>24[(J2I)69I;&5L:7-T)2([,#LP*20-"CL@;&]N9R!L:6YE#0JD
      MJ2%3971!<G)A>2`E9FEL96QI<W0E/:2I/WLH2#TR-#M4/4$I1DE,15,@;V8@
      M8VAO<V5N(&5X=&5N<VEO;B`M+2!.;R!C:&]I8V4@<75I=',]/:2I)7-E;&5C
      M="6DJ25F:6QE;&ES="5]#0H[#0JDJ2%)9B"DJ25F:6QE;&ES="4]I*DE96UP
      M='DE($5.1`T*.E1!4TL-"J2I(5-E="`E8V]U;G0E/:2I)69I;&5L:7-T,"4[
      M("5I;F1E>"4],`T*.DY%6%1405-+#0JDJ2%);F,@)6EN9&5X)0T*I*DA268@
      MI*DE:6YD97@E(#X@I*DE8V]U;G0E($5.1`T*.R"DJ2%);F9O("*DJ25D969P
      M871H):2I)69I;&5L:7-TI*DE:6YD97@E)2(-"J2I(41E<W1R;WE$;V,@(J2I
      M)61E9G!A=&@EI*DE9FEL96QI<W2DJ25I;F1E>"4E(@T*I*DA1V]T;R!.15A4
      *5$%32PT*.D5.1`
      `
      end


      H="DELETING .LOG/.RPT FILES"
      ^!Clearvariables
      ^!SetScreenUpdate 0
      :START
      ^!SetWizardTitle Delete Log And Rpt Files
      ^!SetWizardLabel log and rpt Files Only In Filelist...
      ; long line
      ^!Set %defpath%=^?{(H=32;T=D)Pick File Folder=^$GetDocumentPath$};
      %hint%=^?{Leave Blank or Type Filename Hint To Look For=^%empty%};
      %ext%=^?{Pick Or Type In FilesTypes To Display=_rpt & log|*.rpt|*.log};
      %plus%=^?{Subfolders?==Include^=+|_Exclude^=^%empty%};
      %select%=^?{Autoselect Files?==YES^=_|_NO^=^%empty%}
      ^!IfSame "rpt & log" "^%ext" ^!Set %ext%="*.rpt;^%hint%*.log"
      ;
      ^!SetListDelimiter |^%select%
      ^!Set %filelist%=^$GetFiles("^%plus%^%defpath%";"^%hint%^%ext%";name)$
      ^!Set %filelist%=^$StrReplace("^%defpath%";^%empty%;"^%filelist%";0;0)$
      ; long line
      ^!SetArray %filelist%=^?{(H=24;T=A)FILES of chosen extension -- No
      choice quits==^%select%^%filelist%}
      ;
      ^!If ^%filelist%=^%empty% END
      :TASK
      ^!Set %count%=^%filelist0%; %index%=0
      :NEXTTASK
      ^!Inc %index%
      ^!If ^%index% > ^%count% END
      ; ^!Info "^%defpath%^%filelist^%index%%"
      ^!DestroyDoc "^%defpath%^%filelist^%index%%"
      ^!Goto NEXTTASK
      :END
      ---- end marker ----






      Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    • hsavage
      ... John, One other advantage, IMO, heretofore unmentioned I believe, ^!DestroyDoc sends the files to the recycle bin, giving you a chance to recover from
      Message 2 of 9 , Aug 8 10:06 AM
        Wright, John - Textron Financial wrote:

        >Whew! Thanks so much for the wealth of information. This clip is now in my
        >library.
        >
        >
        >Wright, John - Textron Financial wrote:
        >
        > > I can't seem to find anything on what I'm trying
        > > to do.
        > >
        > > ^!DestroyDoc A483AR51.rpt
        >
        >John,
        >
        >When you are presented with the filelist just put a checkmark in the box
        >for every file you want to ^!DestroyDoc then click .
        >
        >hrs

        John,

        One other advantage, IMO, heretofore unmentioned I believe, ^!DestroyDoc
        sends the files to the recycle bin, giving you a chance to recover from
        boo-boo's. ^!DeleteFile seems to eradicate the file with little chance
        of recovery.

        hrs
      • Jody
        Hi John, ... Just a friendly reminder to delete the text that is not needed to understand your reply. TIA No apologies needed. :-) ... Happy Clip n! Jody
        Message 3 of 9 , Aug 8 11:10 AM
          Hi John,

          >Whew! Thanks so much for the wealth of information. This clip is
          >now in my library.

          Just a friendly reminder to delete the text that is not needed to
          understand your reply. TIA No apologies needed. :-)

          > H="UUD kwik"
          > ;_Modified~Updated~Created_7/30/03_11:12:16a
          > ;_hsavage@...

          Happy Clip'n!
          Jody

          http://www.notetab.net
          http://www.notetab.net/html/cd-info.htm

          UnSubscribe, Options
          mailto:ntb-Clips-UnSubscribe@yahoogroups.com
          http://groups.yahoo.com/group/ntb-clips
        • Larry Thomas
          Hi John and Harvey, I am just posting this clip to show what a person (me) can learn by exploring somebody else s ideas of doing things. I replied with There
          Message 4 of 9 , Aug 10 2:53 PM
            Hi John and Harvey,

            I am just posting this clip to show what a person (me) can learn by
            exploring somebody else's ideas of doing things. I replied with "There is
            no way of doing wildcards in NoteTab that I know of.". Well, I have
            certainly learned better now. The previous clip did not do what you said
            you wanted to do because I could not think of a way to use wildcards on the
            open documents so I though that was the best that I was going to be able to
            do. Then yesterday Don Don Daugherty posted another reply to another post
            and he used the command ^!IfMatch in his reply. That put a bee in my
            bonnet and I started thinking really hard about it and you know, I found
            that I could use it to write a clip that does exactly what you wrote about
            on open documents in NoteTab.

            First the clip uses ^!Document Last to go to the last open document tab in
            the open documents. Next, the ^!IfMatch line tests the file name against
            your pattern which you enter into a wizard set up in it to see if the file
            name matches. It does not use wildcards the way you listed but it does use
            regular expressions which are similar to DOS wildcards. You can enter your
            examples of A483AR*.log or A483AR*.rpt as A483AR.*\.log or A483AR.*\.rpt
            which will get the result you are looking for. Then the clip will
            ^!DestroyDoc on the open document which will remove the document from the
            list of tabs and move the focus to the previous tab if the pattern is found
            or it will branch to ^!Document Prev which will move the focus to the
            previous document tab if the pattern does not match. Then the clip checks
            the document index position to see if it is on the first open document tab.
            If it is, it goes to the finish routine and checks the document to see if
            it should be deleted and deletes it or not and then quits. If it is not
            the first document tab, the clip loops back for the next open document and
            keeps looping until it reaches the first document tab and then processes it
            and quits.

            Here is the clip - Only 14 lines long:

            Just Modify/Join the two long lines and remove the long line markers and
            add it to your library to use it. I have tested it using ^!Close instead
            of ^!DestroyDoc and it works. I used ^!DestroyDoc with no parameters on
            individual open documents and it sends the documents to the recycle bin,
            removes them from the open tabs, and moves the tab focus back to the
            previous document. ^!Close does the same as ^!DestroyDoc but it does not
            send the document to the recycle bin so I thought that was good enough to
            use for testing purposes and when I used it, it workded the way I wanted it
            to.

            ______[Copy below this line]_______
            H="Test IfMatch"
            ;lrt@... e¿ê
            ;08/10/2003, 04:14:23 PM
            ^!SetScreenupdate 0
            ^!Document Last
            :Loop
            ;
            ;----------------------[begin long line]---------------------------
            ^!IfMatch "^?[Enter RegExp Pattern (Pattern.*\.Ext)=]"
            "^$GetFileName(^**)$" Next ELSE PrevDoc
            ;-----------------------[end long line]----------------------------
            ;
            ^!DestroyDoc
            ^!Goto Loop
            :PrevDoc
            ^!Document Prev
            ^!If ^$GetDocIndex$ = 1 Finish ELSE Next
            ^!Goto Loop
            :Finish
            ;
            ;----------------------[begin long line]---------------------------
            ^!IfMatch "^?[Enter RegExp Pattern (Pattern.*\.Ext)=]"
            "^$GetFileName(^**)$" Next ELSE Exit
            ;-----------------------[end long line]----------------------------
            ;
            ^!DestroyDoc
            _____[Copy above this line]______
            | right click over the clipbook |
            | and choose "Add from Clipboard" |
            ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

            My point here is that you helped me learn something new about NoteTab's
            programing that I did not know by asking your question. Thank you very
            much for the experience. This is something that I can use on clips that I
            am thinking about writing for my own personal use.

            Regards,

            Larry
            lrt@... e¿ê
          • Wright, John - Textron Financial
            Larry, I like it, it s very elegent. One problem, I m getting a syntax error on the Match statement. I m sure it must be something I m doing wrong. Maybe it s
            Message 5 of 9 , Aug 11 6:46 AM
              Larry,
              I like it, it's very elegent. One problem, I'm getting a syntax error on the
              Match statement. I'm sure it must be something I'm doing wrong. Maybe it's
              what I'm entering into the wizzard, but I've tried every combination I can
              think of.
              I did join the two portions of the long lines before attempting to run it.

              -----Original Message-----
              From: Larry Thomas [mailto:larryt@...]
              Sent: Sunday, August 10, 2003 5:54 PM
              To: ntb-clips@yahoogroups.com
              Subject: RE: [Clip] DestroyDoc



              Hi John and Harvey,

              I am just posting this clip to show what a person (me) can learn by
              exploring somebody else's ideas of doing things. I replied with "There is
              no way of doing wildcards in NoteTab that I know of.". Well, I have
              certainly learned better now.
            • Larry Thomas
              ... You must use regular expressions for your patterns when entering patterns. In regular expressions, a period is a meta character and it is interpreted as
              Message 6 of 9 , Aug 11 1:20 PM
                At 09:46 AM 8/11/03 -0400, you wrote:
                >Larry,
                >I like it, it's very elegent. One problem, I'm getting a syntax error on the
                >Match statement. I'm sure it must be something I'm doing wrong. Maybe it's
                >what I'm entering into the wizzard, but I've tried every combination I can
                >think of.
                >I did join the two portions of the long lines before attempting to run it.


                You must use regular expressions for your patterns when entering patterns.
                In regular expressions, a period is a meta character and it is interpreted
                as "any" character except for a newline <cr/lf> pair. An asterisk (*)
                means zero or more occurences of the previous character and a back slash
                (\) is an escape character which cause the pattern to treat the next
                character as a litteral character. Without the back slash, the period is
                treated as a meta character by the regexp search engine but with the back
                slash just before the period or any other meta character, the meta
                character is treated as just a plain text character. A \. os just a period
                and \* is just an asterisk. The exception to this rule are the special
                situations set for special characters (\n for newline, \s for a space, and
                \t for a tab).

                You can find help for using NoteTab's regexp patterns by going to Help/Help
                Topics/Reference Information/Dialog boxes/Regular Expressions.

                There is one other problem that I have found. When you set a pattern to
                find all files and recycle them, the clip will not stop without preessing
                and holding the Ctrl+Alt Keys. I fixed this by moving the line:

                ^!If ^$GetDocIndex$ = 1 Finish ELSE Next

                From just before the ^!Goto Loop line to just after the :Loop label. Now
                it works with all patterns.

                I have copied mine back from the email and rejoined the lines and I do not
                get a syntax error. You need to use regular expressions in the wizard, not
                DOS wildcards.


                Regards,

                Larry
                lrt@... e¿ê
              Your message has been successfully submitted and would be delivered to recipients shortly.