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

"Mark of the Web" clip?

Expand Messages
  • jhenk83
    Is anybody willing to create a clip that would automate the Mark of the Web procedure needed for web pages with java or javascript to eliminate the warning
    Message 1 of 6 , Dec 28, 2004
    • 0 Attachment
      Is anybody willing to create a clip that would automate the "Mark of
      the Web" procedure needed for web pages with java or javascript to
      eliminate the warning on XP service pack 2? The programming skills
      needed to create such a clip are far beyond my abilities.

      Here is a Mark of the Web sample needed for page1.htm.
      <!-- saved from url=(0032)http://www.example.com/page1.htm -->

      The clip would first request the user to enter the web site address:
      http://www.example.com/

      And then once the user presses Enter...

      The current page name (page1.htm) is automatically added to the end
      of the web site address, the number of characters in the string are
      added in front of the updated address (0032), and the resulting text
      is added between the <head> </head> tags.

      This would sure simplify the convoluted method I am now using by
      manually typing the text and using the text statistics option to
      count the characters. Thank you in advance if anyone is up to this
      challenge.
    • Don - htmlfixit.com
      ... Are you editing the html in notetab at the time? Is the file saved to your hard drive? If so it sounds easy enough to me. But I am not familiar with the
      Message 2 of 6 , Dec 28, 2004
      • 0 Attachment
        jhenk83 wrote:
        >
        >
        > Is anybody willing to create a clip that would automate the "Mark of
        > the Web" procedure needed for web pages with java or javascript to
        > eliminate the warning on XP service pack 2? The programming skills
        > needed to create such a clip are far beyond my abilities.

        Are you editing the html in notetab at the time? Is the file saved to
        your hard drive?
        If so it sounds easy enough to me. But I am not familiar with the
        context in which you are working.
        I cannot add something between head tags of a page you are viewing on
        the web.

        This appears to work, but could be simplified greatly, for example if
        run so it gets the url of the current page if you are saving it from
        your browser etc. I didn't error trap, for example I assume there is a
        head tag. I assume you are editing the file, so I keep track of where
        the cursor is and return it.

        ; by don at htmlfixit.com
        ;inserts a comment in the head section
        ;for the currently edited document
        ^!ClearVariables
        ;assemble url
        ^!Set %string%=^?[please type web site url (no http:// please)]
        ^!Set %filename%=^?[please type filename (no leading / please)]
        ^!Set %url%=http://^%string%/^%filename%
        ;figure out where cursor is
        ^!Set %row%="^$GetRow$"
        ^!Set %column%="^$GetCol$"
        ;find the head tag (no error trap added)
        ^!Find "</head>" CIWS
        ;go just before head
        ^!Jump Select_Start
        ;get the length of the url and zero pad to 4 characters
        ^!Set %len%=^$StrAlign("^$StrSize(^%url%)$";4;Right;True)$
        ^!Set %len%=^$StrReplace(" ";"0";"^%len%";False;False)$
        ;insert the comment above head with a return
        ^!InsertText <!-- saved from url=(^%len%)^%url% -->^P
        ;return cursor back where we started
        ;note we added a row ... so need to add one to row
        ^!SetCursor ^$Calc(^%row%+1)$:^%column%
      • jhenk83
        Hi, Wow this is almost perfect. I am editing the web pages on the hard drive of my computer with NoteTab. There are multiple pages that need to have the
        Message 3 of 6 , Dec 29, 2004
        • 0 Attachment
          Hi, Wow this is almost perfect. I am editing the web pages on the
          hard drive of my computer with NoteTab. There are multiple pages that
          need to have the comment added. I was hoping to be able to add the
          basic web site url address where the pages will be uploaded and then
          have the clip automatically find the open page name and add it at the
          end of the url. I would also like the url address to remain for the
          entire work session, so that when I click on the next open page I can
          simply click the clip to add the comment with the correct page name
          to that page. The comments need to be added to all the open pages. Is
          that possible? Even without any changes, this clip already greatly
          simplifies the repetive task. Thanks for all your hard work,
          John

          --- In ntb-clips@yahoogroups.com, "Don - htmlfixit.com" <don@h...>
          wrote:
          > jhenk83 wrote:
          > >
          > >
          > > Is anybody willing to create a clip that would automate the "Mark
          of
          > > the Web" procedure needed for web pages with java or javascript
          to
          > > eliminate the warning on XP service pack 2? The programming
          skills
          > > needed to create such a clip are far beyond my abilities.
          >
          > Are you editing the html in notetab at the time? Is the file saved
          to
          > your hard drive?
          > If so it sounds easy enough to me. But I am not familiar with the
          > context in which you are working.
          > I cannot add something between head tags of a page you are viewing
          on
          > the web.
          >
          > This appears to work, but could be simplified greatly, for example
          if
          > run so it gets the url of the current page if you are saving it
          from
          > your browser etc. I didn't error trap, for example I assume there
          is a
          > head tag. I assume you are editing the file, so I keep track of
          where
          > the cursor is and return it.
          >
          > ; by don at htmlfixit.com
          > ;inserts a comment in the head section
          > ;for the currently edited document
          > ^!ClearVariables
          > ;assemble url
          > ^!Set %string%=^?[please type web site url (no http:// please)]
          > ^!Set %filename%=^?[please type filename (no leading / please)]
          > ^!Set %url%=http://^%string%/^%filename%
          > ;figure out where cursor is
          > ^!Set %row%="^$GetRow$"
          > ^!Set %column%="^$GetCol$"
          > ;find the head tag (no error trap added)
          > ^!Find "</head>" CIWS
          > ;go just before head
          > ^!Jump Select_Start
          > ;get the length of the url and zero pad to 4 characters
          > ^!Set %len%=^$StrAlign("^$StrSize(^%url%)$";4;Right;True)$
          > ^!Set %len%=^$StrReplace(" ";"0";"^%len%";False;False)$
          > ;insert the comment above head with a return
          > ^!InsertText <!-- saved from url=(^%len%)^%url% -->^P
          > ;return cursor back where we started
          > ;note we added a row ... so need to add one to row
          > ^!SetCursor ^$Calc(^%row%+1)$:^%column%
        • Don - htmlfixit.com
          ... Try this ... watch for the long line. The one continue doesn t work as it gives a scroll bar. I think I have the cursor repositioning correctly now (you
          Message 4 of 6 , Dec 29, 2004
          • 0 Attachment
            jhenk83 wrote:
            >
            > Hi, Wow this is almost perfect. I am editing the web pages on the
            > hard drive of my computer with NoteTab. There are multiple pages that
            > need to have the comment added. I was hoping to be able to add the
            > basic web site url address where the pages will be uploaded and then
            > have the clip automatically find the open page name and add it at the
            > end of the url. I would also like the url address to remain for the
            > entire work session, so that when I click on the next open page I can
            > simply click the clip to add the comment with the correct page name
            > to that page. The comments need to be added to all the open pages. Is
            > that possible? Even without any changes, this clip already greatly
            > simplifies the repetive task. Thanks for all your hard work,
            > John

            Try this ... watch for the long line. The one continue doesn't work as
            it gives a scroll bar.
            I think I have the cursor repositioning correctly now (you add/subtract
            a line at various points depending on if you are adding or deleting
            above or below where you started). It also removes an existing tag (not
            multiples however). I turn wordwrap off ... I have around here
            somewhere the little ditty to test if it is on and return to the state
            it was in ... in the next go around. Is this a step toward where you
            want to go? If so, you next want it to cycle through all open files?

            ; by don at htmlfixit.com
            ;inserts a comment in the head section
            ;for the currently edited document
            ^!ClearVariables
            ;wordwrap may cause problems
            ^!SetWordWrap OFF
            ;figure out where cursor is
            ^!Set %row%="^$GetRow$"
            ^!Set %column%="^$GetCol$"
            ;check for existing "Mark of the Web" tag
            ^!Find "<!-- saved from url=(" TIWS
            ^!IfError process ELSE existing_tag
            ;remove if exists with confirmation
            :existing_tag
            ^!Select Eol
            ^!Continue Existing Mark of Web Tag - OK to delete and replace or cancel
            to stop
            ^!Keyboard BACKSPACE BACKSPACE
            ;correct row for the line we just removed
            ^!If ^%row% > ^%row_head% Skip_1
            ^!Set %row%=^$Calc(^%row%-1)$


            :process
            ;Save all modified files otherwise you will
            ;get temporary file names like efo~1.html
            ^!Continue Hit OK to save all files and process or Cancel to abort clip
            ^!Save ALL
            ;assemble url for insertion (get sitename)
            ;long line follows
            ^!Set %string%=^?{please type web site url (no http:// please - but
            include any subdirectories)=^$GetValue("MarkOfTheWeb:site")$}
            ;end of long line
            ;save value to ini file so it returns on re-run
            ^!SaveValue MarkOfTheWeb:site=^%string%
            ;get the name of the current file
            ^!Set %filename%=^$GetFileName(^**)$
            ;create complete url
            ^!Set %url%=http://^%string%/^%filename%
            ;find the head tag (no error trap added)
            ^!Find "</head>" CIWS
            ;go just before head
            ^!Jump Select_Start
            ;figure out where cursor is now so we know if we
            ;were before or after it ... to know whether we need
            ;to add a row when repositioning
            ^!Set %row_head%="^$GetRow$"

            ;get the length of the url and zero pad to 4 characters
            ^!Set %len%=^$StrAlign("^$StrSize(^%url%)$";4;Right;True)$
            ^!Set %len%=^$StrReplace(" ";"0";"^%len%";False;False)$
            ;insert the comment above head with a return
            ^!InsertText <!-- saved from url=(^%len%)^%url% -->^P
            ;return cursor back where we started
            ;note we added a row ... so need to add one to row
            ;if cursor was after the head tag

            ^!If ^%row% < ^%row_head% Skip_1
            ^!Set %row%=^$Calc(^%row%+1)$
            ^!SetCursor ^%row%:^%column%
          • John Henk
            Hi Don, The new solution didn t work for me. It may be too sophisticated for what I want to do. Here is how I am trying to use the clip: I have a folder on the
            Message 5 of 6 , Dec 29, 2004
            • 0 Attachment
              Hi Don,
              The new solution didn't work for me. It may be too sophisticated for what I want to do. Here is how I am trying to use the clip:

              I have a folder on the desktop called "myhtmfiles" and in it are "testpage1.htm", "testpage2.htm", and "testpage3.htm" files. The folder temporarily stores the web pages for editing. Later, I will upload the three files to the website.

              I open NoteTab and load the three pages with "testpage1.htm" as the active page. My goal is to type the basic URL (mysite.onweb.com) and have the clip create the full URL (with active page filename and extension) inside the Mark of the Web comment just above the </head> tag as shown below:
              <HTML>
              <HEAD>
              <TITLE></TITLE>
              <!-- saved from url=(0041)http://www.mysite.onweb.com/testpage1.htm -->
              </HEAD>
              <BODY>
              </BODY>
              </HTML>

              I now click on "testpage2.htm" to make it the active page. What I hoped could happen is to have the previously typed basic URL reappear in the dialog box so that I wouldn't have to retype it. I would just have to press Enter to have the testpage2.htm Mark of the Web comment saved with the correct filename on that page.
              <HTML>
              <HEAD>
              <TITLE></TITLE>
              <!-- saved from url=(0041)http://www.mysite.onweb.com/testpage2.htm -->
              </HEAD>
              <BODY>
              </BODY>
              </HTML>

              I would then click on testpage3.htm in NoteTab to make it active and would then repeat the process for that page.

              Thanks again for all you efforts,
              John



              "Don - htmlfixit.com" <don@...> wrote:
              jhenk83 wrote:
              >
              > Hi, Wow this is almost perfect. I am editing the web pages on the
              > hard drive of my computer with NoteTab. There are multiple pages that
              > need to have the comment added. I was hoping to be able to add the
              > basic web site url address where the pages will be uploaded and then
              > have the clip automatically find the open page name and add it at the
              > end of the url. I would also like the url address to remain for the
              > entire work session, so that when I click on the next open page I can
              > simply click the clip to add the comment with the correct page name
              > to that page. The comments need to be added to all the open pages. Is
              > that possible? Even without any changes, this clip already greatly
              > simplifies the repetive task. Thanks for all your hard work,
              > John

              Try this ... watch for the long line. The one continue doesn't work as
              it gives a scroll bar.
              I think I have the cursor repositioning correctly now (you add/subtract
              a line at various points depending on if you are adding or deleting
              above or below where you started). It also removes an existing tag (not
              multiples however). I turn wordwrap off ... I have around here
              somewhere the little ditty to test if it is on and return to the state
              it was in ... in the next go around. Is this a step toward where you
              want to go? If so, you next want it to cycle through all open files?

              ; by don at htmlfixit.com
              ;inserts a comment in the head section
              ;for the currently edited document
              ^!ClearVariables
              ;wordwrap may cause problems
              ^!SetWordWrap OFF
              ;figure out where cursor is
              ^!Set %row%="^$GetRow$"
              ^!Set %column%="^$GetCol$"
              ;check for existing "Mark of the Web" tag
              ^!Find "<!-- saved from url=(" TIWS
              ^!IfError process ELSE existing_tag
              ;remove if exists with confirmation
              :existing_tag
              ^!Select Eol
              ^!Continue Existing Mark of Web Tag - OK to delete and replace or cancel
              to stop
              ^!Keyboard BACKSPACE BACKSPACE
              ;correct row for the line we just removed
              ^!If ^%row% > ^%row_head% Skip_1
              ^!Set %row%=^$Calc(^%row%-1)$


              :process
              ;Save all modified files otherwise you will
              ;get temporary file names like efo~1.html
              ^!Continue Hit OK to save all files and process or Cancel to abort clip
              ^!Save ALL
              ;assemble url for insertion (get sitename)
              ;long line follows
              ^!Set %string%=^?{please type web site url (no http:// please - but
              include any subdirectories)=^$GetValue("MarkOfTheWeb:site")$}
              ;end of long line
              ;save value to ini file so it returns on re-run
              ^!SaveValue MarkOfTheWeb:site=^%string%
              ;get the name of the current file
              ^!Set %filename%=^$GetFileName(^**)$
              ;create complete url
              ^!Set %url%=http://^%string%/^%filename%
              ;find the head tag (no error trap added)
              ^!Find "</head>" CIWS
              ;go just before head
              ^!Jump Select_Start
              ;figure out where cursor is now so we know if we
              ;were before or after it ... to know whether we need
              ;to add a row when repositioning
              ^!Set %row_head%="^$GetRow$"

              ;get the length of the url and zero pad to 4 characters
              ^!Set %len%=^$StrAlign("^$StrSize(^%url%)$";4;Right;True)$
              ^!Set %len%=^$StrReplace(" ";"0";"^%len%";False;False)$
              ;insert the comment above head with a return
              ^!InsertText <!-- saved from url=(^%len%)^%url% -->^P
              ;return cursor back where we started
              ;note we added a row ... so need to add one to row
              ;if cursor was after the head tag

              ^!If ^%row% < ^%row_head% Skip_1
              ^!Set %row%=^$Calc(^%row%+1)$
              ^!SetCursor ^%row%:^%column%


              Yahoo! Groups SponsorADVERTISEMENT


              ---------------------------------
              Yahoo! Groups Links

              To visit your group on the web, go to:
              http://groups.yahoo.com/group/ntb-clips/

              To unsubscribe from this group, send an email to:
              ntb-clips-unsubscribe@yahoogroups.com

              Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



              ---------------------------------
              Do you Yahoo!?
              Take Yahoo! Mail with you! Get it on your mobile phone.

              [Non-text portions of this message have been removed]
            • Don - htmlfixit.com
              ... John, That is exactly what the clip does. I wrote you off line suggesting you try to catch me a minute in chat over at http://htmlfixit.com where we can
              Message 6 of 6 , Dec 30, 2004
              • 0 Attachment
                John Henk wrote:
                > Hi Don,
                > The new solution didn't work for me. It may be too sophisticated for what I want to do. Here is how I am trying to use the clip:
                >
                > I have a folder on the desktop called "myhtmfiles" and in it are "testpage1.htm", "testpage2.htm", and "testpage3.htm" files. The folder temporarily stores the web pages for editing. Later, I will upload the three files to the website.
                >
                > I open NoteTab and load the three pages with "testpage1.htm" as the active page. My goal is to type the basic URL (mysite.onweb.com) and have the clip create the full URL (with active page filename and extension) inside the Mark of the Web comment just above the </head> tag as shown below:

                John,

                That is exactly what the clip does. I wrote you off line suggesting you
                try to catch me a minute in chat over at http://htmlfixit.com where we
                can run through it to shorten the process. I suspect a broken line
                there somewhere.

                My copy of the clip does each of these things:
                - check if there is an existing mark of the web tag and delete it
                - retrieve the url if you already gave it one
                - present it in a box so you can change it or just click ok to leave it
                the same
                - save whatever you entered so it is available in the future
                - get the name of the file for the link automatically
                -add that all into a mark of the web tag
                -return the cursor to whereever it was when you started


                It worked fine here in testing, so I suspect a line wrap issue.
              Your message has been successfully submitted and would be delivered to recipients shortly.