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

Running other programs with command lines

Expand Messages
  • dwc77
    If you want to run other programs on the document that is displayed in notetab, how to do this? I am a dummy with command line stuff. Lets say the command line
    Message 1 of 5 , Jul 9, 2004
    • 0 Attachment
      If you want to run other programs on the document that is displayed
      in notetab, how to do this? I am a dummy with command line stuff.
      Lets say the command line syntax for the program is like this;
      prog.exe parameters D:\folder\filename.htm
      The D:\folder\filename.htm would be the current document you are
      displaying with notetab, and of course program-name.exe is the
      program name. However, most of the time the program will not be in
      the notetab folder and will usually be in its own folder, like this;
      C:\Program Files\folder\prog.exe
      I assume the C:\Program Files\program-folder\ part is required?
      Maybe it would be easier if i put a shortcut to the program inside
      the notetab folder and point to that instead (?), but dunno if a
      command line will work that way using parameters etc. Anyway with
      parameters xyz i thought it would be something simple like this;

      ^$GetDocName$
      ^!CommandLine C:\Program Files\folder\prog.exe xyz $GetDocName$

      But of course this doesnt work, says there is line2 error. Also
      tried the shortcut in notetab folder and that didnt work either.
    • John Zeman
      ... You re close. Use ^!Shell instead of ^!CommandLine For example, either of the following two lines will open the document currently open in NoteTab, in the
      Message 2 of 5 , Jul 9, 2004
      • 0 Attachment
        --- In ntb-clips@yahoogroups.com, "dwc77" <dwc@f...> wrote:
        > If you want to run other programs on the document that is displayed
        > in notetab, how to do this? I am a dummy with command line stuff.
        > Lets say the command line syntax for the program is like this;
        > prog.exe parameters D:\folder\filename.htm
        > The D:\folder\filename.htm would be the current document you are
        > displaying with notetab, and of course program-name.exe is the
        > program name. However, most of the time the program will not be in
        > the notetab folder and will usually be in its own folder, like this;
        > C:\Program Files\folder\prog.exe
        > I assume the C:\Program Files\program-folder\ part is required?
        > Maybe it would be easier if i put a shortcut to the program inside
        > the notetab folder and point to that instead (?), but dunno if a
        > command line will work that way using parameters etc. Anyway with
        > parameters xyz i thought it would be something simple like this;
        >
        > ^$GetDocName$
        > ^!CommandLine C:\Program Files\folder\prog.exe xyz $GetDocName$
        >
        > But of course this doesnt work, says there is line2 error. Also
        > tried the shortcut in notetab folder and that didnt work either.

        You're close. Use ^!Shell instead of ^!CommandLine

        For example, either of the following two lines will open the document
        currently open in NoteTab, in the Internet Explorer (Be aware of any
        line breaks inserted by yahoo or your email program as each of the
        next two lines are long lines)).

        ^!Shell "C:\Program Files\Internet Explorer\iexplore.exe"
        ^$GetDocName$

        ^!Shell "C:\Program Files\Internet Explorer\iexplore.exe" ^**

        The difference between the two is, ^$GetDocName$ opens the last saved
        version of the active document while ^** opens the current version in
        a temporary file if it was not saved before running the clip. If the
        current document was saved before running the clip, there is no
        difference between the two.

        Note the double quotes ("") that surround all paths that include
        spaces.

        John
      • dwc77
        ... document ... any ... saved ... in ... the ... Thanks for quick answer John. I still cant get it to work for the program i am currently wanting to use it
        Message 3 of 5 , Jul 10, 2004
        • 0 Attachment
          --- In ntb-clips@yahoogroups.com, "John Zeman" <john041650@y...>
          >
          > You're close. Use ^!Shell instead of ^!CommandLine
          >
          > For example, either of the following two lines will open the
          document
          > currently open in NoteTab, in the Internet Explorer (Be aware of
          any
          > line breaks inserted by yahoo or your email program as each of the
          > next two lines are long lines)).
          >
          > ^!Shell "C:\Program Files\Internet Explorer\iexplore.exe"
          > ^$GetDocName$
          >
          > ^!Shell "C:\Program Files\Internet Explorer\iexplore.exe" ^**
          >
          > The difference between the two is, ^$GetDocName$ opens the last
          saved
          > version of the active document while ^** opens the current version
          in
          > a temporary file if it was not saved before running the clip. If
          the
          > current document was saved before running the clip, there is no
          > difference between the two.
          >
          > Note the double quotes ("") that surround all paths that include
          > spaces.
          >
          > John

          Thanks for quick answer John. I still cant get it to work for the
          program i am currently wanting to use it for, its an old program
          called Pretty Html, basically just arranges all the tags, inserts
          comments, compresses etc in a very customizable way. Doesnt do
          anything a clip couldnt do, but it would take an extremely complex
          clip to equal it though. The company is no longer around so no
          support, but no need for it really.
          Anyway, from a regular command line it works fine;

          "C:\Program Files\Pretty HTML 3.7\prettyhtml.exe" -ftba
          D:\folder\file.htm

          Those parameters open the program, apply formatting to the document,
          and close the program. Works fine. But when i make the clip in
          notetab like this;

          ^!Shell "C:\Program Files\Pretty HTML 3.7\prettyhtml.exe" -ftba
          $GetDocName$
          ^$GetDocName$

          It displays (prints) the document path where the cursor is and opens
          the program, but nothing else. It looks to me like the document path
          is not being supplied to (inserted into) the command line. I mean,
          wouldnt you want to GetDocName first and then run the command line?
          Well i tried it that way and it did the same thing. Anyone know
          whats wrong here?
          Folks, THIS is why command line stuff and programming in general is
          so maddening to me, i always end up spending hours trying to get
          something like this to work so i can save a few seconds. I have seen
          many programmers and most of them still have their hair. How is this
          possible?
          Also, when you say "^** opens the current version in a temporary
          file if it was not saved before running the clip", does that mean it
          has to have been saved by notetab itself? In other words, what if
          you just opened an existing document? Whats the purpose of this?
        • John Zeman
          ... the ... version ... document, ... opens ... path ... seen ... this ... it ... I see Larry has answered the question on how NoteTab handles saved vs temp
          Message 4 of 5 , Jul 10, 2004
          • 0 Attachment
            --- In ntb-clips@yahoogroups.com, "dwc77" <dwc@f...> wrote:
            > --- In ntb-clips@yahoogroups.com, "John Zeman" <john041650@y...>
            > >
            > > You're close. Use ^!Shell instead of ^!CommandLine
            > >
            > > For example, either of the following two lines will open the
            > document
            > > currently open in NoteTab, in the Internet Explorer (Be aware of
            > any
            > > line breaks inserted by yahoo or your email program as each of
            the
            > > next two lines are long lines)).
            > >
            > > ^!Shell "C:\Program Files\Internet Explorer\iexplore.exe"
            > > ^$GetDocName$
            > >
            > > ^!Shell "C:\Program Files\Internet Explorer\iexplore.exe" ^**
            > >
            > > The difference between the two is, ^$GetDocName$ opens the last
            > saved
            > > version of the active document while ^** opens the current
            version
            > in
            > > a temporary file if it was not saved before running the clip. If
            > the
            > > current document was saved before running the clip, there is no
            > > difference between the two.
            > >
            > > Note the double quotes ("") that surround all paths that include
            > > spaces.
            > >
            > > John
            >
            > Thanks for quick answer John. I still cant get it to work for the
            > program i am currently wanting to use it for, its an old program
            > called Pretty Html, basically just arranges all the tags, inserts
            > comments, compresses etc in a very customizable way. Doesnt do
            > anything a clip couldnt do, but it would take an extremely complex
            > clip to equal it though. The company is no longer around so no
            > support, but no need for it really.
            > Anyway, from a regular command line it works fine;
            >
            > "C:\Program Files\Pretty HTML 3.7\prettyhtml.exe" -ftba
            > D:\folder\file.htm
            >
            > Those parameters open the program, apply formatting to the
            document,
            > and close the program. Works fine. But when i make the clip in
            > notetab like this;
            >
            > ^!Shell "C:\Program Files\Pretty HTML 3.7\prettyhtml.exe" -ftba
            > $GetDocName$
            > ^$GetDocName$
            >
            > It displays (prints) the document path where the cursor is and
            opens
            > the program, but nothing else. It looks to me like the document
            path
            > is not being supplied to (inserted into) the command line. I mean,
            > wouldnt you want to GetDocName first and then run the command line?
            > Well i tried it that way and it did the same thing. Anyone know
            > whats wrong here?
            > Folks, THIS is why command line stuff and programming in general is
            > so maddening to me, i always end up spending hours trying to get
            > something like this to work so i can save a few seconds. I have
            seen
            > many programmers and most of them still have their hair. How is
            this
            > possible?
            > Also, when you say "^** opens the current version in a temporary
            > file if it was not saved before running the clip", does that mean
            it
            > has to have been saved by notetab itself? In other words, what if
            > you just opened an existing document? Whats the purpose of this?



            I see Larry has answered the question on how NoteTab handles saved vs
            temp documents. See if his suggestions solve your launching problem.

            About Pretty HTML. I've never used it but have you ever considered
            using HTML Tidy instead? From what you say it sounds like Tidy and
            Pretty HTML are basically the same. What's really nice about Tidy is
            NoteTab has built in support for it. It's been awhile since I've
            done this so I'm not positive this next will be absolutely right but
            I think you just download Tidy, store it in your

            C:\Program Files\Notetab Pro

            Folder (or where your NoteTab program is stored) then you can run it
            on the current document open in NoteTab by going to the menu command
            of TOOLS/TIDY HTML CODE. Optionally you can create a tidy.cfg file
            to set various options in how Tidy formats your document and checks
            it for basic errors. If you're interested (it's free) the home page
            for Tidy is here:

            http://tidy.sourceforge.net/

            Look for the Executable Binaries for the downloads. Interestingly
            enough the version I use is not on that list, at the moment I can't
            tell you which is the most current but I can tell you I'm happy with
            the Tidy version I have. If nothing else you can download
            tidy_win32.exe here:

            http://www.isk.kth.se/kursinfo/6b2927/resurser/downloads/HTMLTidy/

            As Larry mentioned if you have just opened a document in NoteTab and
            haven't done anything with it yet, there is no need for a temporary
            file. However suppose you've opened a document, typed a few things
            in it, but haven't saved it yet and then open that same document in
            another program??? What should the other program display? The
            original saved document? Or a document that shows the current
            contents of the file even though it hasn't been saved? NoteTab gives
            you the choice, again refer to Larry's response for a good
            explanation of how that works.

            John
          • dwc77
            ... vs ... problem. ... considered ... and ... is ... but ... it ... command ... file ... checks ... page ... can t ... with ... and ... temporary ... things
            Message 5 of 5 , Jul 10, 2004
            • 0 Attachment
              --- In ntb-clips@yahoogroups.com, "John Zeman" <john041650@y...>
              wrote:
              > I see Larry has answered the question on how NoteTab handles saved
              vs
              > temp documents. See if his suggestions solve your launching
              problem.
              >
              > About Pretty HTML. I've never used it but have you ever
              considered
              > using HTML Tidy instead? From what you say it sounds like Tidy
              and
              > Pretty HTML are basically the same. What's really nice about Tidy
              is
              > NoteTab has built in support for it. It's been awhile since I've
              > done this so I'm not positive this next will be absolutely right
              but
              > I think you just download Tidy, store it in your
              >
              > C:\Program Files\Notetab Pro
              >
              > Folder (or where your NoteTab program is stored) then you can run
              it
              > on the current document open in NoteTab by going to the menu
              command
              > of TOOLS/TIDY HTML CODE. Optionally you can create a tidy.cfg
              file
              > to set various options in how Tidy formats your document and
              checks
              > it for basic errors. If you're interested (it's free) the home
              page
              > for Tidy is here:
              >
              > http://tidy.sourceforge.net/
              >
              > Look for the Executable Binaries for the downloads. Interestingly
              > enough the version I use is not on that list, at the moment I
              can't
              > tell you which is the most current but I can tell you I'm happy
              with
              > the Tidy version I have. If nothing else you can download
              > tidy_win32.exe here:
              >
              > http://www.isk.kth.se/kursinfo/6b2927/resurser/downloads/HTMLTidy/
              >
              > As Larry mentioned if you have just opened a document in NoteTab
              and
              > haven't done anything with it yet, there is no need for a
              temporary
              > file. However suppose you've opened a document, typed a few
              things
              > in it, but haven't saved it yet and then open that same document
              in
              > another program??? What should the other program display? The
              > original saved document? Or a document that shows the current
              > contents of the file even though it hasn't been saved? NoteTab
              gives
              > you the choice, again refer to Larry's response for a good
              > explanation of how that works.
              >
              > John

              John, i have tried tidy in the past along with the "fix image tags"
              clip from Jody. Although tidy does a few things that Pretty Html
              doesnt, in terms of formatting (arrangement) html neither tidy
              or anything else i have seen comes close to the options in PH. It
              formats each tag in almost any concievable way, inserts comments
              wherever you want, makes backups, compresses, etc. Since tidy is
              commandline it might be able to be coded to do the same things, but
              as with making a custom clip it would take many many hours (or
              probably days for me). I took a look once at a tidy.cfg file and
              didnt know what 9 out of 10 of the lines meant. PH with its graphic
              interface takes about 5 minutes to configure, you just check off all
              the various options for each tag and a few other things. I am quite
              surprised that notetab doesnt come with some type of html formatting
              commands like this built in. It has the basic modify>change html
              tags functions, but thats it. Seems like a big ommission for a
              program thats used so oftem for html coding. Sure does do virtually
              everything else though so cant complain too much.
            Your message has been successfully submitted and would be delivered to recipients shortly.