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

Re: [Clip] Get file name without path

Expand Messages
  • Alec Burgess
    ... Is there an option somewhere I ve missed? When I tried this on a new file that has never been written to disk I get filename.ext . For any file that
    Message 1 of 6 , Sep 9, 2002
    • 0 Attachment
      > If you're not in a clip, right click on the tab in question
      > and click on Copy Name, that will copy the filename.ext to the
      > clipboard.

      Is there an option somewhere I've missed? When I tried this on a new
      file that has never been written to disk I get "filename.ext". For any
      file that exists on disk rClick on tab - copy name gives
      full_path_spec\filename.ext

      Also: Where is the documentation of the contents of the context menu
      when clicking on a tab? Normally [F1] would be expected to give this but
      using [F1] anywhere in on the main pane goes to "Edit Documents" and I
      don't find any entries for Context Menu on the Help Index-tab or using
      the Search-tab.

      Regards ... Alec

      ---- Original Message ----
      From: "hsavage" <hsavage@...>
      To: <ntb-clips@yahoogroups.com>
      Sent: 09 September, 2002 19:07
      Subject: Re: [Clip] Get file name without path

      > º skinnerbird wrote:
      > º
      > º Once again, this is probably something simple that I'm
      > overlooking º (apologies...)
      > º
      > º Is there an easy way to retrieve the current filename and
      > extension º withOUT the path?
      > º
      > º
      > º --Geoffrey
      > º
      >
      > Geoffrey,
      >
      > Easy enough, try this in a clip, from NoteTab help.
      >
      > ^$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.
      >
      >
      > hrs
      >
      >
      > ------------------------ Yahoo! Groups Sponsor
      > ---------------------~--> 4 DVDs Free +s&p Join Now
      > http://us.click.yahoo.com/pt6YBB/NXiEAA/MVfIAA/dkFolB/TM
      > ---------------------------------------------------------------------~
      ->
      >
      >
      >
      > Your use of Yahoo! Groups is subject to
      > http://docs.yahoo.com/info/terms/
    • hsavage
      º Alec Burgess wrote: º º If you re not in a clip, right click on the tab in question º and click on Copy Name, that will copy the filename.ext to the º
      Message 2 of 6 , Sep 9, 2002
      • 0 Attachment
        º Alec Burgess wrote:
        º
        º If you're not in a clip, right click on the tab in question
        º and click on Copy Name, that will copy the filename.ext to the
        º clipboard.
        º
        º
        º Is there an option somewhere I've missed? When I tried this on a new
        º file that has never been written to disk I get "filename.ext". For any
        º file that exists on disk rClick on tab - copy name gives
        º full_path_spec\filename.ext
        º
        º Also: Where is the documentation of the contents of the context menu
        º when clicking on a tab? Normally [F1] would be expected to give this but
        º using [F1] anywhere in on the main pane goes to "Edit Documents" and I
        º don't find any entries for Context Menu on the Help Index-tab or using
        º the Search-tab.
        º
        º Regards ... Alec

        Alec,

        No, I don't think you're missing anything. When I did the Copy Name
        test it was on an unsaved file also.

        Sorry about the oversight.

        For Geoffrey's benefit here's a one line clip that will save only the
        filename.ext to the clipboard regardless of it being a saved or unsaved
        file.


        h="getfilename"
        ^!SetClipboard ^$GetFileName("^##")$


        ^$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.

        hrs
      • skinnerbird
        ... the ... unsaved ... and URLs. ... Thank you very much -- as I suspected, it was the wildcard that I was overlooking. For some reason, I missed the
        Message 3 of 6 , Sep 10, 2002
        • 0 Attachment
          --- In ntb-clips@y..., hsavage <hsavage@p...> wrote:

          >
          > For Geoffrey's benefit here's a one line clip that will save only
          the
          > filename.ext to the clipboard regardless of it being a saved or
          unsaved
          > file.
          >
          >
          > h="getfilename"
          > ^!SetClipboard ^$GetFileName("^##")$
          >
          >
          > ^$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.
          >
          > hrs

          Thank you very much -- as I suspected, it was the wildcard that I was
          overlooking. For some reason, I missed the reference. Your clip plus
          a paste is exactly what I need. Thanks again.

          --Geoffrey
        • Jody
          Hi skinnerbird, ... For future reference you can get any part of the full file name/path that you want. Test on a saved file and a file that needs saving with
          Message 4 of 6 , Sep 10, 2002
          • 0 Attachment
            Hi skinnerbird,

            > > h="getfilename"
            > > ^!SetClipboard ^$GetFileName("^##")$

            For future reference you can get any part of the full file name/path
            that you want. Test on a saved file and a file that needs saving
            with the following code.

            ^$GetPath("^##")^$^$GetFile("^##")$^$GetExt("^##")$
            ^$GetFileName("^#")$
            ^$GetPath("^**")^$^$GetFile("^**")$^$GetExt("^**")$

            ^$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.

            You can cross reference ^$GetDocName to some others.

            >Thank you very much -- as I suspected, it was the wildcard that I
            >was overlooking. For some reason, I missed the reference. Your
            >clip plus a paste is exactly what I need. Thanks again.


            Happy Clip'n!
            Jody

            http://www.notetab.net

            Subscribe, UnSubscribe, Options
            mailto:Ntb-Clips-Subscribe@yahoogroups.com
            mailto:Ntb-Clips-UnSubscribe@yahoogroups.com
            http://groups.yahoo.com/group/ntb-clips
          Your message has been successfully submitted and would be delivered to recipients shortly.