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

Re: [Clip] Can a clip run the last run clip on all open docs?

Expand Messages
  • Jeff Scism
    Thanks!!! I had done another method that required me to triple click each webpage, but automated is a lot faster when dealing with hundreds of pages. Really
    Message 1 of 6 , Jun 9, 2007
    • 0 Attachment
      Thanks!!!

      I had done another method that required me to triple click each
      webpage, but automated is a lot faster when dealing with hundreds of pages.

      Really appreciate it!

      hsavage wrote:
      >
      > Jeff Scism wrote:
      > > I have a clip I use to decapitate webpages, (remove the head), but can
      > > not figure out how to make it run on all open docs in NoteTab STD 5.1.
      > >
      > > Decapitate HTML
      > >
      > > ^!Find </head> TIWS
      > > ^!Jump SELECT_END
      > > ^!SelectTo 1:1
      > > ^!Menu EDIT/CUT
      > >
      > > What I thought would be handy would be a clip that
      > > selects the last run clip, and runs it on all open
      > > docs. Anyone have an idea on how to do it? That way
      > > you could run a clip, and then have it repeat that
      > > process on all open docs ( or optionally all
      > > docs in a directory).
      > >
      > > Thanks!
      > >
      > > Jeff
      >
      > Jeff,
      >
      > Here's a simple clip to do all open htm? docs, all ?htm docs in a folder
      > is a little more involved but, fairly easily done.
      >
      > -----------------
      > H="Decapitate Html"
      > ^!SetScreenUpdate 0
      > ^!SetErrorLabel END
      > ^!Document FIRST
      > :NEXT
      > ^!If ^$GetExt(^##)$ = .htm DECAPITATE
      > ^!If ^$GetExt(^##)$ = .html DECAPITATE
      > ^!Document NEXT
      > ^!GoTo NEXT
      > :DECAPITATE
      > ^!Find </head> TIWS
      > ^!Jump SELECT_END
      > ^!SelectTo 1:1
      > ^!Menu EDIT/CUT
      > ^!Document NEXT
      > ^!GoTo NEXT
      > -----------------
      >
      > ºvº SL-6-69 -created- 2007.06.09 - 12.50.43
      >
    • hsavage
      ... pages. ... Jeff, If you want to do highly populated folders this clip will allow you to select any folder with .htm? you want to decapitate, does all htm s
      Message 2 of 6 , Jun 10, 2007
      • 0 Attachment
        Jeff Scism wrote:
        > Thanks!!!
        >
        > I had done another method that required me to triple click each
        > webpage, but automated is a lot faster when dealing with hundreds of
        pages.
        >
        > Really appreciate it!
        >
        > hsavage wrote:
        >> Jeff Scism wrote:
        >>> I have a clip I use to decapitate webpages,
        >>> (remove the head), but can not figure out how
        >>> to make it run on all open docs in NoteTab STD 5.1.

        Jeff,

        If you want to do highly populated folders this clip will
        allow you to select any folder with .htm? you want to
        decapitate, does all htm's without exception, also allow
        you to operate on subfolders if you want.

        With the ^!Close SAVE line in action the 'heads' will be unrecoverable.
        Be sure to read the clip comment lines.

        I've tested this on a folder/subfolder with 48 files in each folder with
        no problems.


        ---
        H="Decapitate Html"
        ; • Modified-Updated~Created_20070610
        ; • hrs ø hsavage·pobox·com_10:31:58a
        ^!ClearVariables
        ;^!SetWizardTitle "DECAPITATE HTM? FILES"
        ^!SetWizardLabel "Select Folder And Choose Whether To Do SubFolders"
        ^!SetScreenUpdate 0
        ; edit next 'long' line to reflect your 'C:\starting_folder\sub_folder\'
        ;
        ^!Set %path%=^?{(T=D)Select Folder To Work On=C:\+r2rweb\lists\};
        %subs%=^?{Edit Files In Path/SubFolders Also==YES^=+|_NO^=^%empty%}
        ;
        ^!Set %file%=^$GetFileFirst("^%subs%^%path%";*.*htm*;;unsorted)$
        ^!If '^%file%' = '^%EMPTY%' END
        :LOOP
        ; various file actions may be placed between dashed lines
        ; delay may need increasing or may not be needed at all.
        ^!Open ^%file%
        ^!Delay 1
        ;------------------------
        :DECAPITATE
        ^!Find </head> IWS
        ^!Jump SELECT_END
        ^!SelectTo 1:1
        ^!Menu EDIT/CUT
        ; by manipulating the next 2 lines you can leave
        ; files open or close each one as it's modified
        ; or leave each one open, modified, and unsaved.
        ;^!Save
        ^!Close SAVE
        ;------------------------
        ^!Set %file%=^$GetFileNext$
        ^!If ^%file% = ^%EMPTY% NEXT ELSE LOOP
        ^!CloseFileFind
        :END
        ^!StatusShow No Files With The Sought-After Extensions!
        ^!Delay 15
        ---

        • Copy Clip To Clipboard, RightClick
        • ClipBook At proposed location,
        • Click "Add from Clipboard"

        Carefully watch for email wrapped lines

        ºvº SL-6-76 -created- 2007.06.10 - 10.24.10

        Newspaper HeadLine...
        "4-H Girls Win Prizes for Fat Calves"
        ¤ ø ¤ hrs ø hsavage@...
      • Jeff Scism
        I am using this to eliminate existing heads and then pasting a standard configuration in place. So it works ok with ^!Close Save. My ultimate plan is to have
        Message 3 of 6 , Jun 10, 2007
        • 0 Attachment
          I am using this to "eliminate" existing heads and then pasting a
          standard configuration in place. So it works ok with ^!Close Save.

          My ultimate plan is to have the heads controlled by CSS, if I ever
          figure that out, however I am finally making progress in learning how to
          clip program.

          Thanks again for your help.

          Jeff

          hsavage wrote:
          >
          > ---
          > H="Decapitate Html"
          > ; • Modified-Updated~Created_20070610
          > ; • hrs ø hsavage·pobox·com_10:31:58a
          > ^!ClearVariables
          > ;^!SetWizardTitle "DECAPITATE HTM? FILES"
          > ^!SetWizardLabel "Select Folder And Choose Whether To Do SubFolders"
          > ^!SetScreenUpdate 0
          > ; edit next 'long' line to reflect your 'C:\starting_folder\sub_folder\'
          > ;
          > ^!Set %path%=^?{(T=D)Select Folder To Work On=C:\+r2rweb\lists\};
          > %subs%=^?{Edit Files In Path/SubFolders Also==YES^=+|_NO^=^%empty%}
          > ;
          > ^!Set %file%=^$GetFileFirst("^%subs%^%path%";*.*htm*;;unsorted)$
          > ^!If '^%file%' = '^%EMPTY%' END
          > :LOOP
          > ; various file actions may be placed between dashed lines
          > ; delay may need increasing or may not be needed at all.
          > ^!Open ^%file%
          > ^!Delay 1
          > ;------------------------
          > :DECAPITATE
          > ^!Find </head> IWS
          > ^!Jump SELECT_END
          > ^!SelectTo 1:1
          > ^!Menu EDIT/CUT
          > ; by manipulating the next 2 lines you can leave
          > ; files open or close each one as it's modified
          > ; or leave each one open, modified, and unsaved.
          > ;^!Save
          > ^!Close SAVE
          > ;------------------------
          > ^!Set %file%=^$GetFileNext$
          > ^!If ^%file% = ^%EMPTY% NEXT ELSE LOOP
          > ^!CloseFileFind
          > :END
          > ^!StatusShow No Files With The Sought-After Extensions!
          > ^!Delay 15
          > ---
          >
          > • Copy Clip To Clipboard, RightClick
          > • ClipBook At proposed location,
          > • Click "Add from Clipboard"
          >
          > Carefully watch for email wrapped lines
          >
          > ºvº SL-6-76 -created- 2007.06.10 - 10.24.10
          >
          > Newspaper HeadLine...
          > "4-H Girls Win Prizes for Fat Calves"
          > ¤ ø ¤ hrs ø hsavage@...
          >
          >
          >
          >
          >
          > Fookes Software: http://www.fookes.com/
          > Fookes Software Discussion Lists: http://www.fookes.com/groups.php
          > Yahoo! Groups Links
          >
          >
          >
          >
          >
        • abairheart
          ... There are a number of approaches to do this. 1. Save the clipname in the INI file, have the second clip run the clip stored that way: In every clip you
          Message 4 of 6 , Jun 18, 2007
          • 0 Attachment
            --- In ntb-clips@yahoogroups.com, Jeff Scism <Scismgenie@...> wrote:
            >
            > I have a clip I use to decapitate webpages, (remove the head), but can
            > not figure out how to make it run on all open docs in NoteTab STD 5.1.
            >
            > Decapitate HTML
            >
            > ^!Find </head> TIWS
            > ^!Jump SELECT_END
            > ^!SelectTo 1:1
            > ^!Menu EDIT/CUT
            >
            > What I thought would be handy would be a clip that selects the last run
            > clip, and runs it on all open docs.



            There are a number of approaches to do this.

            1. Save the clipname in the INI file,
            have the second clip run the clip stored that way:

            In every clip you consider for this treatment, add the line:
            ^!SaveValue LastRun:Clipname=^$GetClipName$

            In the clip that you want to have the last-run clip operate on all docs:

            ^!Set %clipname%=^$GetValue(LastRun:Clipname)$
            ^!Set %docs%=^$GetDocCount$
            :LOOP
            ^!SetDocindex ^%docs%
            ^!Clip "^%clipname%"
            ^!Dec %docs%
            ^!If ^%docs%>0 LOOP

            2. a second way is of course, to simply wrap the loop above around the
            code you want to run on all docs:

            ^!Set %docs%=^$GetDocCount$
            :LOOP
            ^!SetDocindex ^%docs%
            ;
            ;place your action code here
            ;
            ^!Dec %docs%
            ^!If ^%docs%>0 LOOP



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