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

Tip: several modeless info windows

Expand Messages
  • loro
    Hi, Thought I d share this since I find it handy. I tend to keep lists of useful information in my libraries and I used to show them in an info window. For
    Message 1 of 10 , May 7, 2009
    View Source
    • 0 Attachment
      Hi,

      Thought I'd share this since I find it handy. I tend to keep lists of
      useful information in my libraries and I used to show them in an info
      window. For example I have a list of reserved words in my JS library
      and so on. It always annoyed me that I had to use a modal window and
      needed to click it away before I could use Notetab again, because
      often I need the look at the list soon again.

      Now to the good part. There's a MS technology called HTA, HTML
      Applications. A HTA is basically a HTML page but it runs as an
      application. That is, it gets it's own independent window. IE won't
      try to reuse it when you click a link or a shortcut. You can even
      give it its own icon that will show up on the toolbar, You can make
      it look different than a normal browser window. It won't interrupt
      your work, it can be minimized and you can open several HTAs at the
      same time. There's more to HTA than this. A HTA allows more
      scripting access than a normal HTML page, but I don't know much about
      that and it isn't important for this.

      Basically you can just name a HTML page to .hta instead of .html. But
      if you make use of the <HTA> tag you can change the look of the
      window, give it an icon and so on and it's more fun.
      http://msdn.microsoft.com/en-us/library/ms536471(vs.85).aspx

      You run a HTA from Notetab as you would any program, with ^!Shell. I
      keep all of my "info windows" and their icons in a folder called
      'Info* inside Libraries, so for me it's like this.
      ^!Shell "^$GetLibraryPath$Info\something.hta"

      I paste an example below so you can see how it works. Just copy and
      save as something.hta and click the icon to run it. In case you are
      curious it's just an unfinished list of how much a dl, a tablespoon
      and a teaspoon of stuff like salt and sugar weighs. ;-)

      ________________________________
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
      "http://www.w3.org/TR/html4/strict.dtd">

      <html>

      <head>
      <title>Måttomvandling</title>

      <!-- Below is the HTA bit -->
      <HTA:APPLICATION
      applicationName = "Socker"
      caption = "yes"
      borderStyle = "static"
      innerBorder = "yes"
      icon = "mått.ico">
      <!-- /END HTA -->


      <style type="text/css">
      <!--
      body { margin: 0; padding: .2em .3em 0;
      background: #f8f8f8; color: #555;
      font: 85% Verdana, sans-serif }
      h3 { font-size: 105%; margin: 0; margin-top: .2em; margin-bottom: -.2em }
      h2 { font-size: 115%; margin: 0; margin-top: .5em }
      ul { margin: 0 }
      -->
      </style>


      <!-- The JS below is just for resizing the window.
      Change the parameters in the parenthesis (w,h)
      to what you want or remove it altogether -->
      <script type="text/javascript">
      <!--
      function resizeIt()
      {
      window.resizeTo(200,350);
      }
      onload = resizeIt;
      //-->
      </script>

      </head>


      <body>

      <h2>Omvandlingstabell</h2>
      <h3>Strösocker</h3>
      <ul>
      <li>1 dl = ca 90 g</li>
      <li>1 msk = 15 g</li>
      <li>1 tsk = 5 g</li>
      </ul>
      <h3>Fruktsocker</h3>
      <ul>
      <li>1 dl = ca 70 g</li>
      <li>1 msk = ca 12 g</li>
      <li>1 tsk = ca 4 g</li>
      </ul>
      <h3>Sirap</h3>
      <ul>
      <li>1 dl = 140 g</li>
      <li>1 msk = 20 g</li>
      <li>1 tsk = 7 g</li>
      </ul>
      <h2>Mjöl</h2>
      <h3>Vetemjöl</h3>
      <ul>
      <li>1 dl = 60 g</li>
      <li>1 msk = 9 g</li>
      </ul>

      </body>
      </html>
      ____________________________


      Hope you like it. :-)
      Lotta
    • Don - HtmlFixIt.com
      what does it do in Firefox or other web browsers Loro?
      Message 2 of 10 , May 7, 2009
      View Source
      • 0 Attachment
        what does it do in Firefox or other web browsers Loro?

        loro wrote:
        > Hi,
        >
        > Thought I'd share this since I find it handy. I tend to keep lists of
        > useful information in my libraries and I used to show them in an info
        > window. For example I have a list of reserved words in my JS library
        > and so on. It always annoyed me that I had to use a modal window and
        > needed to click it away before I could use Notetab again, because
        > often I need the look at the list soon again.
        >
        > Now to the good part. There's a MS technology called HTA, HTML
        > Applications. A HTA is basically a HTML page but it runs as an
      • loro
        ... You ll likely get a Save dialogue, I guess. Maybe I wasn t clear. You aren t supposed to open it as a webpage. You are supposed to run it as a program from
        Message 3 of 10 , May 7, 2009
        View Source
        • 0 Attachment
          Don - wrote:
          >what does it do in Firefox or other web browsers Loro?

          You'll likely get a Save dialogue, I guess. Maybe I wasn't clear. You
          aren't supposed to open it as a webpage. You are supposed to run it
          as a program from Notetab, or from any other shortcut of you prefer.

          Of course Windows uses IE to run it. Everyone on a Windows system
          have and use IE, either they use it to browse the web or not.

          Lotta
        • Sheri
          ... I think it s quite cool, Lotta, thanks for sharing. You guys need to change the icon in Loro s code to one you actually have. Looks like the specified icon
          Message 4 of 10 , May 7, 2009
          View Source
          • 0 Attachment
            loro wrote:
            > Don - wrote:
            >
            >> what does it do in Firefox or other web browsers Loro?
            >>
            >
            > You'll likely get a Save dialogue, I guess. Maybe I wasn't clear. You
            > aren't supposed to open it as a webpage. You are supposed to run it
            > as a program from Notetab, or from any other shortcut of you prefer.
            >
            > Of course Windows uses IE to run it. Everyone on a Windows system
            > have and use IE, either they use it to browse the web or not.
            >
            > Lotta
            >
            I think it's quite cool, Lotta, thanks for sharing.

            You guys need to change the icon in Loro's code to one you actually
            have. Looks like the specified icon shows in the upper left of the hta
            app window. You would need to specify it again for a windows shortcut or
            toolbar entry. I tried an exe and the exe's icon showed. It doesn't seem
            to work with icon libraries though. I was hoping to use icons that are
            in icl's.

            Regards,
            Sheri
          • loro
            ... Welcome. :-) ... I said it would show on the toolbar, didn t I? I talked about the one besides the tray. Oops! That s the taskbar in English, isn t it? Oh
            Message 5 of 10 , May 7, 2009
            View Source
            • 0 Attachment
              Sheri wrote:
              >I think it's quite cool, Lotta, thanks for sharing.

              Welcome. :-)

              >You guys need to change the icon in Loro's code to one you actually
              >have. Looks like the specified icon shows in the upper left of the hta
              >app window. You would need to specify it again for a windows shortcut or
              >toolbar entry.

              I said it would show on the toolbar, didn't I? I talked about the one
              besides the tray. Oops! That's the taskbar in English, isn't it? Oh
              well. There the icon will show anyway. ;-o)

              Forgot to say that for those that don't want to fiddle with HTML, you
              can just enclose the text in PRE tags and format the text as you
              normally do in Notetab. PRE will retain the formatting.

              ______________
              <html>
              <head>
              <title>Title</title>

              <!-- Below is the HTA bit -->
              <HTA:APPLICATION
              applicationName = "Mått"
              caption = "yes"
              borderStyle = "static"
              innerBorder = "yes"
              icon = "socker.ico">
              <!-- /END HTA -->

              <!-- The JS below is just for resizing the window.
              Change the parameters in the parenthesis (w,h)
              to what you want or remove it altogether -->
              <script type="text/javascript">
              <!--
              function resizeIt()
              {
              window.resizeTo(200,350);
              }
              onload = resizeIt;
              //-->
              </script>

              </head>


              <body>


              <!-- Just paste your text formatted in NTP between the PRE tags. -->
              <pre>
              bla bla

              aaa bbb ccc
              111 222 333
              xxx yyy zzz
              </pre>

              </body>
              </html>
              ______________


              Lotta
            • lm_hamilton
              ... Cool idea Lotta! Thanks! I see now why you use the ^!Shell, if you just open the *hta file in NoteTab and use F8 or Shift+F8 to launch it in IE it gives
              Message 6 of 10 , May 8, 2009
              View Source
              • 0 Attachment
                --- In ntb-clips@yahoogroups.com, loro <loro-spam01-@...> wrote:
                >
                > Hi,
                >
                > Thought I'd share this since I find it handy. I tend to keep lists of
                > useful information in my libraries and I used to show them in an info
                > window.

                Cool idea Lotta! Thanks!

                I see now why you use the ^!Shell, if you just open the *hta file in NoteTab and use F8 or Shift+F8 to launch it in IE it gives the security warning and takes an extra action to choose "Run".

                Via ^!Shell, it just pops up.

                Also just double-clicking the file in Explorer just pops up.

                I too, have lots of bits & pieces that I need to refer to regularly.

                Thanks!

                ~ Larry
              • lm_hamilton
                ... I also found that using a NoteTab shortcut makes it just pop up. [!C: NoteTab Documents HTA-Test.hta] (The ! makes it open the file in the default
                Message 7 of 10 , May 8, 2009
                View Source
                • 0 Attachment
                  --- In ntb-clips@yahoogroups.com, "lm_hamilton" <lmh@...> wrote:
                  > I see now why you use the ^!Shell, if you just open the *hta file in NoteTab and use F8 or Shift+F8 to launch it in IE it gives the security warning and takes an extra action to choose "Run".
                  >
                  > Via ^!Shell, it just pops up.
                  >
                  > Also just double-clicking the file in Explorer just pops up.

                  I also found that using a NoteTab shortcut makes it just pop up.

                  [!C:\NoteTab\Documents\HTA-Test.hta] (The ! makes it open the file in the default program.)

                  ~ Larry
                • loro
                  ... Yup. Just like a program. ... You are welcome, Larry. There are some tricky bits though. Sometimes things you do won t work. I originally had problems to
                  Message 8 of 10 , May 8, 2009
                  View Source
                  • 0 Attachment
                    lm_hamilton wrote:
                    >I see now why you use the ^!Shell, if you just open the *hta file in
                    >NoteTab and use F8 or Shift+F8 to launch it in IE it gives the
                    >security warning and takes an extra action to choose "Run".
                    >
                    >Via ^!Shell, it just pops up.
                    >
                    >Also just double-clicking the file in Explorer just pops up.

                    Yup. Just like a program.

                    >I too, have lots of bits & pieces that I need to refer to regularly.
                    >
                    >Thanks!

                    You are welcome, Larry.

                    There are some tricky bits though. Sometimes things you do won't
                    work. I originally had problems to get to get links to work, but
                    after quite a lot of searching I found a solution. Problem is, it's
                    been several years since I tried to learn a little about this so I
                    have forgotten what I did, but it's bound to be in those few lines of
                    HTA code. Anyhow, links now pop in an independent, ordinary, browser
                    window. So it's also useful to keep a list of links to resources
                    related to the library in question in a HTA.

                    Other problems occurred in other situations Some I never found the
                    solution to. There really is more to this than meets the eye. But I
                    think this vanilla version works for most things. I've used the same
                    template ever since and so far so good. One day I'll get to the
                    bottom of this HTA stuff, but no hurry, huh?

                    The little piece of JavaScript that resizes the window has caused an
                    error at a few random occasions (Access denied). I have no idea why.
                    But rebooting or simply not opening a HTA for a while has resolved
                    it. The last is very peculiar, I think. Maybe something hangs in
                    memory. Possibly this could be resolved by the use of some HTA
                    attribute, I don't know, but it doesn't happen often anyway.

                    P.S. Sorry for any typos and spellos. My age related problem with
                    seeing at close distance has worsened dramatically lately. 2 weeks
                    ago I just needed to squint a little. Now it's hard to even make out
                    the letters. I had no idea these things could step up so fast.
                    Ordered terminal glasses today, but I'll have to wait 4 weeks. Groan!
                    You'll have to bear with me until then, I'm afraid. I've gone though
                    this 3 times, so hopefully I've nuked the worst ones. ;-)

                    Lotta, heavily squinting.
                  • Blaine Clark
                    Tidy question ... I like to tidy up my code and Tidy refuses to do anything with the tag and then skips the entire file. The only way I
                    Message 9 of 10 , May 9, 2009
                    View Source
                    • 0 Attachment
                      Tidy question ... I like to 'tidy up' my code and Tidy refuses to do
                      anything with the <HTA:APPLICATION /> tag and then skips the entire
                      file. The only way I can Tidy is to leave the HTA tag out until I'm
                      done, run Tidy and then plug in the HTA tag with options. Is there a
                      configuration I'm missing for Tidy, or is this work-around the way to go?




                      [Non-text portions of this message have been removed]
                    • loro
                      ... Probably not. I don t use Tidy, maybe it s possible to tell it that HTA is OK. But HTA is totally proprietary, so it s unknown to both Tidy and validators.
                      Message 10 of 10 , May 10, 2009
                      View Source
                      • 0 Attachment
                        Blaine Clark wrote:
                        >Tidy question ... I like to 'tidy up' my code and Tidy refuses to do
                        >anything with the <HTA:APPLICATION /> tag and then skips the entire
                        >file. The only way I can Tidy is to leave the HTA tag out until I'm
                        >done, run Tidy and then plug in the HTA tag with options. Is there a
                        >configuration I'm missing for Tidy, or is this work-around the way to go?


                        Probably not. I don't use Tidy, maybe it's possible to tell it that
                        HTA is OK. But HTA is totally proprietary, so it's unknown to both
                        Tidy and validators. A validator wouldn't refuse to work with the
                        document though. It would just throw errors and point out that HTA
                        and its attributes don't exist "in this version of HTML".

                        This all isn't so important as it is otherwise though, since you
                        aren't going to put this on the web. Although there could be other
                        browsers than IE that are aware of HTA. Works in Opera (but not FF)
                        for example. But Opera shows it just as a HTML page, so not fun!
                        There could be others too.

                        Hope someone who uses Tidy can give a better answer.

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