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

Re: [Clip] DestroyDoc

Expand Messages
  • hsavage
    ... first ... look for ... John, The paragraph above should read as below. ^!DestroyDoc requires the filename only if it is a doc that hasn t been written to
    Message 1 of 8 , Aug 7, 2003
    • 0 Attachment
      hsavage wrote:

      > > Wright, John - Textron Financial wrote:
      > >
      > > I have been using NTP for almost three years, but have never really
      > > embraced
      > > clip coding - too intimidated by it.
      > >
      > > 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.
      > >
      > > ^!DestroyDoc A483AR51.rpt

      > John,
      >
      > ^!DestroyDoc requires the filename only if it is a doc that hasn't been
      > written to disk yet, it requires the full path/filename if it isn't the
      > focused doc and has been written to disk.
      >

      John,

      The paragraph above should read as below.

      ^!DestroyDoc requires the filename only if it is a doc that hasn't been
      written to disk yet, may be focused or unfocused.

      It requires the full path/filename whether it is focused or unfocused
      and has already been written to disk.

      hrs
    • hsavage
      ... destroy any ... 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
      Message 2 of 8 , Aug 8, 2003
      • 0 Attachment
        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 ----
      • Manuel123
        One more time question. How can I pass the variable hoy to combo ^!Set %hoy%=^$GetDate(mm/dd/yyyy)$ ^!Set %fecha%=^?[Dime fecha==^%hoy%] ... Cursos para
        Message 3 of 8 , Aug 18, 2003
        • 0 Attachment
          One more time question. How can I pass the variable hoy to combo

          ^!Set %hoy%=^$GetDate(mm/dd/yyyy)$
          ^!Set %fecha%=^?[Dime fecha==^%hoy%]
          ---
          Cursos para ciegos. http://www.solotxt.com
          Windows,Iexplorer,Outlook,Html,Word,Excel,Access
          ---
          Caso de devolución repetidas de respuestas enviar un mensaje de aviso a <incidencias@...>
        • Manuel123
          Sorry. It don t work because I used [ ] and now with { } work ok. Thanks ^!Set %hoy%=^$GetDate(mm/dd/yyyy)$ ^!Set %fecha%=^?{Dime fecha==^%hoy%} ... Cursos
          Message 4 of 8 , Aug 18, 2003
          • 0 Attachment
            Sorry. It don't work because I used [ ] and now with { } work ok.
            Thanks

            ^!Set %hoy%=^$GetDate(mm/dd/yyyy)$
            ^!Set %fecha%=^?{Dime fecha==^%hoy%}
            ---
            Cursos para ciegos. http://www.solotxt.com
            Windows,Iexplorer,Outlook,Html,Word,Excel,Access
            ---
            Caso de devolución repetidas de respuestas enviar un mensaje de aviso a <incidencias@...>
          • loro
            ... From Help ( Clip Wizard and Fields ): If a function is used in square brackets ^?[Today s date is=^$GetDate$] the actual function would be seen in the
            Message 5 of 8 , Aug 18, 2003
            • 0 Attachment
              Manuel123 wrote:
              >One more time question. How can I pass the variable hoy to combo
              >
              >^!Set %hoy%=^$GetDate(mm/dd/yyyy)$
              >^!Set %fecha%=^?[Dime fecha==^%hoy%]

              From Help ("Clip Wizard and Fields"):
              "If a function is used in square brackets ^?[Today's date is=^$GetDate$] the actual function would be seen in the prompt because the square brackets are processed first, but the function will not be processed until after it is reached in the script. On the other hand, since curly braces and functions are processed when the line is processed, the date will be shown in the prompt using ^?{Today's date is=^$GetDate$}. The same is true when using variables."

              So the answer is use curly braces.

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