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

Re: [Clip] Re: Rename/Move

Expand Messages
  • Axel Berger
    ... No. Referring to the clip help I find: ^$GetDocName$ ^$GetDocName(Index)$ (added in v4.52) Returns the active document name, if no index is specified, or
    Message 1 of 6 , Dec 5, 2011
      layman999 wrote:
      > And one other question: What's going on with ^$GetFileName and
      > ^$GetDocName ?

      No. Referring to the clip help I find:

      ^$GetDocName$
      ^$GetDocName(Index)$ (added in v4.52)
      Returns the active document name, if no index is specified, or the
      document name at specified index position. An invalid index number
      returns an empty string. The first document is at index 1.

      What is not said here, but becomes apparent once used, is, that not just
      the name is returned but rather the complete full path.

      ^$GetFileName(FileName)$
      Returns the name and extension of FileName (without path). Since version
      4.8, this function works both on Windows file names and URLs.

      So to get just the file and not the full path you need

      ^$GetFileName(^$GetDocName$)$

      Axel
    • flo.gehrke
      ... Sorry, ^!MoveFile needs a file name and a destination. So you could write... ... ^!SetWizardLabel Move ^$GetFileName(^$GetDocName$)$ to... ^!MoveFile ^##
      Message 2 of 6 , Dec 5, 2011
        --- In ntb-clips@yahoogroups.com, layman999 <layman999@...> wrote:
        >
        > Oops!
        >
        > I didn't actually test the MoveFile part of either of those
        > clips by moving a file before my last response. I'm getting a
        > clip syntax error...

        Sorry, ^!MoveFile needs a file name and a destination. So you could write...

        :Move
        ^!SetWizardLabel Move ^$GetFileName(^$GetDocName$)$ to...
        ^!MoveFile "^##" "^?{(T=D)}"

        Note that you have to close the file and open it anew at its new position when repeating that action (use ^!SetDebug to see why).

        > I think I prefer the bold text in the wizard created by your
        > second proposal. Is that a result of using ^!SetWizardLabel ?

        Yes, I think so. I can see no way to avoid bold text here.

        > And one other question: What's going on with ^$GetFileName and
        > ^$GetDocName ?

        See Axel's explanation. You can easily test such functions with...

        ^!Info ^$GetFileName(^$GetDocName$)$

        resp.

        ^!Info ^$GetDocName$

        Regards,
        Flo
      Your message has been successfully submitted and would be delivered to recipients shortly.