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

testing for a directory...

Expand Messages
  • BHCS
    Julie s save as htm clip looked like something I could use but I wanted to add a little more automation to it. We I did but it DON T! Why does this fail at the
    Message 1 of 3 , Nov 8, 2003
    • 0 Attachment
      Julie's save as htm clip looked like something I could use but I wanted
      to add a little more automation to it. We I did but it DON'T! Why does
      this fail at the ^!IfPathExist line?

      <----- clip below ----->
      ; from Julie at the clips list - 11/08/2003
      ; modified to allow creation of new folder at save operation

      H="Save as HTM"
      ^!Jump 1
      ^!Find "</html>" SI
      ^!IfError NOHTML else SAVE

      :SAVE
      ^!Set %dirpath%="R:\Clients\Web Projects\"
      ^!Set %foldername%=^?[Folder to Save To?]
      ^!Set %filename%=^?[File Name?]
      ; ^!IfPathExist "^%dirpath%^%foldername%" DOSAVE else MAKEDIR ; this
      doesn't work
      ^!IfPathExist ^%dirpath%^%foldername% DOSAVE else MAKEDIR

      :DOSAVE
      ^!Set %new_name%=^?{As:=^%path%^%foldername%\^%filename%.htm}
      ^!Save As "^%new_name%"
      ^!Goto END

      :MAKEDIR
      ; ^!MkDir "^%dirpath%^%foldername%"
      ^!MkDir ^%dirpath%^%foldername%
      ^!Goto DOSAVE

      :NOHTML
      ^!Info This file does not contain a HTML tag!
      <----- clip ends on above line ----->

      Bill
    • funkysmama
      Hi Bill -- I think the only thing you need to do is change this line: ^!Set %new_name%=^?{As:=^%path%^%foldername% ^%filename%.htm} to this: ^!Set
      Message 2 of 3 , Nov 8, 2003
      • 0 Attachment
        Hi Bill --

        I think the only thing you need to do is change this line:

        ^!Set %new_name%=^?{As:=^%path%^%foldername%\^%filename%.htm}

        to this:

        ^!Set %new_name%=^?{As:=^%dirpath%^%foldername%\^%filename%.htm}

        Did that help?

        -- Funky's Mama

        --- In ntb-clips@yahoogroups.com, BHCS <bhc@n...> wrote:
        > Julie's save as htm clip looked like something I could use but I
        wanted
        > to add a little more automation to it. We I did but it DON'T! Why
        does
        > this fail at the ^!IfPathExist line?
        >
        > <----- clip below ----->
        > ; from Julie at the clips list - 11/08/2003
        > ; modified to allow creation of new folder at save operation
        >
        > H="Save as HTM"
        > ^!Jump 1
        > ^!Find "</html>" SI
        > ^!IfError NOHTML else SAVE
        >
        > :SAVE
        > ^!Set %dirpath%="R:\Clients\Web Projects\"
        > ^!Set %foldername%=^?[Folder to Save To?]
        > ^!Set %filename%=^?[File Name?]
        > ; ^!IfPathExist "^%dirpath%^%foldername%" DOSAVE else MAKEDIR ;
        this
        > doesn't work
        > ^!IfPathExist ^%dirpath%^%foldername% DOSAVE else MAKEDIR
        >
        > :DOSAVE
        > ^!Set %new_name%=^?{As:=^%path%^%foldername%\^%filename%.htm}
        > ^!Save As "^%new_name%"
        > ^!Goto END
        >
        > :MAKEDIR
        > ; ^!MkDir "^%dirpath%^%foldername%"
        > ^!MkDir ^%dirpath%^%foldername%
        > ^!Goto DOSAVE
        >
        > :NOHTML
        > ^!Info This file does not contain a HTML tag!
        > <----- clip ends on above line ----->
        >
        > Bill
      • Julie
        I would combine the following two lines into one line separated by a semi-colon, and change the square brackets to curly brackets: ^!Set %foldername%=^?[Folder
        Message 3 of 3 , Nov 8, 2003
        • 0 Attachment
          I would combine the following two lines into one line separated by a
          semi-colon, and change the square brackets to curly brackets:

          ^!Set %foldername%=^?[Folder to Save To?]
          ^!Set %filename%=^?[File Name?]

          to

          ^!Set %foldername%=^?{Folder to Save To?};%filename%=^?{File Name?}

          This way if the file doesn't contain HTML tags, the user will see the info
          box immediately instead of after the wizard pops up.

          From Help:
          When input fields are defined using the square bracket format, the Wizard
          is displayed before the first Clip instruction is executed/evaluated. The
          Wizard is built from all such fields encountered in the script. That is how
          and why you may see multiple input fields in a single Wizard as soon as you
          click on the Clip while others using curly braces may take a little while
          to pop up.

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