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

Trouble passing params to a program

Expand Messages
  • joy8388608
    I use the freeware program AM-DeadLink (http://www.aignes.com/deadlink.htm) which detects dead links and duplicates in browser bookmarks and text files. I
    Message 1 of 4 , May 25, 2010
    • 0 Attachment
      I use the freeware program AM-DeadLink (http://www.aignes.com/deadlink.htm) which detects dead links and duplicates in browser bookmarks and text files.

      I thought it would be a good idea to write a simple clip to check the current (.htm or html) file.
      I could not get it to work and have no idea why. The problem MIGHT be with the program but it may be in my clip so I thought I'd ask.

      I DID get it to work by calling a batch file and also found it only works correctly if I change to the directory of the deadlink.exe program and does not work if I call it using the full path name. The program runs, but it scans my browsers (Opera) bookmarks instead of the current document.

      I'd love to know what's doing on if anyone can figure it out.

      Thanks!
      Joy


      ^!Set %DotExt%=^$GetExt(^$GetFileName(^$GetDocName$)$)$
      ^!Set %DotExt%=^$StrLower("^%DotExt%")$
      ^!If ^%DotExt%=.htm CALICD_IS_HTML
      ^!If ^%DotExt%=.html CALICD_IS_HTML
      ^!Prompt This (current) document must have extension of htm or html
      ^!Goto CALICD_CONT1

      :CALICD_IS_HTML
      ; This SHOULD work, but it checks all the links in Opera's bookmark file.
      ;^!ChDir "H:\Prog Files 2\AM-DeadLink"
      ;^!Shell deadlink /file="^$GetDocName$" /check /exit

      ^!Shell "H:\Documents and Settings\user\My Documents\Batch\ChkLinks.bat" "^$GetDocName$" /check /exit

      :CALICD_CONT1
      ---EXIT---

      ----------------
      REM ChkLinks.bat
      cd "H:\Prog Files 2\AM-DeadLink"
      deadlink /file=%1 /check /exit
      ----------------
    • Sheri
      ... I don t know the answer, but the same problem presents itself when entering the command line directly into a command window. I suspect it has something to
      Message 2 of 4 , May 26, 2010
      • 0 Attachment
        --- In ntb-clips@yahoogroups.com, "joy8388608" <mycroftj@...> wrote:
        >
        > I use the freeware program AM-DeadLink (http://www.aignes.com/deadlink.htm) which detects dead links and duplicates in browser bookmarks and text files.
        >
        > I thought it would be a good idea to write a simple clip to check the current (.htm or html) file.
        > I could not get it to work and have no idea why. The problem MIGHT be with the program but it may be in my clip so I thought I'd ask.
        >
        > I DID get it to work by calling a batch file and also found it only works correctly if I change to the directory of the deadlink.exe program and does not work if I call it using the full path name. The program runs, but it scans my browsers (Opera) bookmarks instead of the current document.
        >
        > I'd love to know what's doing on if anyone can figure it out.
        >
        > Thanks!
        > Joy
        >
        >
        > ^!Set %DotExt%=^$GetExt(^$GetFileName(^$GetDocName$)$)$
        > ^!Set %DotExt%=^$StrLower("^%DotExt%")$
        > ^!If ^%DotExt%=.htm CALICD_IS_HTML
        > ^!If ^%DotExt%=.html CALICD_IS_HTML
        > ^!Prompt This (current) document must have extension of htm or html
        > ^!Goto CALICD_CONT1
        >
        > :CALICD_IS_HTML
        > ; This SHOULD work, but it checks all the links in Opera's bookmark file.
        > ;^!ChDir "H:\Prog Files 2\AM-DeadLink"
        > ;^!Shell deadlink /file="^$GetDocName$" /check /exit
        >
        > ^!Shell "H:\Documents and Settings\user\My Documents\Batch\ChkLinks.bat" "^$GetDocName$" /check /exit
        >
        > :CALICD_CONT1
        > ---EXIT---
        >
        > ----------------
        > REM ChkLinks.bat
        > cd "H:\Prog Files 2\AM-DeadLink"
        > deadlink /file=%1 /check /exit
        > ----------------
        >

        I don't know the answer, but the same problem presents itself when entering the command line directly into a command window. I suspect it has something to do with how a windows Shell consumes double quotes when processing a command line. Using a bat file seems to be a good solution.

        Regards,
        Sheri
      • diodeom
        ... Ditching ^!Shell and invoking this app directly does the trick for me: ^!IfMatch (?i).+ .html? ^$GetDocName$ Skip_2 ^!Prompt This clip needs an
        Message 3 of 4 , Jun 1, 2010
        • 0 Attachment
          "joy8388608" <mycroftj@...> wrote:
          >
          > I use the freeware program AM-DeadLink (http://www.aignes.com/deadlink.htm) which detects dead links and duplicates in browser bookmarks and text files.
          >
          > I thought it would be a good idea to write a simple clip to check the current (.htm or html) file.
          > I could not get it to work and have no idea why. The problem MIGHT be with the program but it may be in my clip so I thought I'd ask.
          >
          > I DID get it to work by calling a batch file and also found it only works correctly if I change to the directory of the deadlink.exe program and does not work if I call it using the full path name. The program runs, but it scans my browsers (Opera) bookmarks instead of the current document.
          >
          > I'd love to know what's doing on if anyone can figure it out.
          >
          > Thanks!
          > Joy
          >
          >
          > ^!Set %DotExt%=^$GetExt(^$GetFileName(^$GetDocName$)$)$
          > ^!Set %DotExt%=^$StrLower("^%DotExt%")$
          > ^!If ^%DotExt%=.htm CALICD_IS_HTML
          > ^!If ^%DotExt%=.html CALICD_IS_HTML
          > ^!Prompt This (current) document must have extension of htm or html
          > ^!Goto CALICD_CONT1
          >
          > :CALICD_IS_HTML
          > ; This SHOULD work, but it checks all the links in Opera's bookmark file.
          > ;^!ChDir "H:\Prog Files 2\AM-DeadLink"
          > ;^!Shell deadlink /file="^$GetDocName$" /check /exit
          >
          > ^!Shell "H:\Documents and Settings\user\My Documents\Batch\ChkLinks.bat" "^$GetDocName$" /check /exit
          >
          > :CALICD_CONT1
          > ---EXIT---
          >
          > ----------------
          > REM ChkLinks.bat
          > cd "H:\Prog Files 2\AM-DeadLink"
          > deadlink /file=%1 /check /exit
          > ----------------
          >

          Ditching ^!Shell and invoking this app directly does the trick for me:

          ^!IfMatch "(?i).+\.html?" "^$GetDocName$" Skip_2
          ^!Prompt This clip needs an HTML/HTM doc!
          ^!Goto End
          ^!"F:ull\Path\deadlink.exe" /file="^$GetDocName$" /check
        • diodeom
          ... It would make sense to replace ^!IfMatch ... with: ^!IfTrue ^$IsHtmlDoc$ Skip_2
          Message 4 of 4 , Jun 1, 2010
          • 0 Attachment
            I wrote:
            >
            > ^!IfMatch "(?i).+\.html?" "^$GetDocName$" Skip_2
            > ^!Prompt This clip needs an HTML/HTM doc!
            > ^!Goto End
            > ^!"F:ull\Path\deadlink.exe" /file="^$GetDocName$" /check
            >

            It would make sense to replace "^!IfMatch ..." with:

            ^!IfTrue ^$IsHtmlDoc$ Skip_2
          Your message has been successfully submitted and would be delivered to recipients shortly.