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

21282Re: First line of text to file name??

Expand Messages
  • Ryck Lent
    Dec 3, 2010
    • 0 Attachment
      WOW!! I have been a user of NT Pro for more years 13? 15? than I can remember,
      and a member of this list for a long time as well. Now I know why!

      Thanks so much for the responses. I will use and tinker with the solutions
      submitted.

      Again, thanks!

      Ryck

      _________________________________________________

      2a. First line of text to file name??
      Posted by: "Ryck Lent" rycklent@... rycklent
      Date: Thu Dec 2, 2010 12:02 pm ((PST))

      I have been searching for a simple clip button to turn the first line of a
      document into the file name. This would be similar to a function in Word that
      proposes the first line as a possible file name when saving the first time.

      Does anyone know if such a clip button function exists already?

      The button function would:

      Select some n of the characters of the fist line of the file
      Save the selected characters in a variable
      Activate the file "Save As" function
      Paste the stored variable into the file name box
      Prompt or confirm file save location
      Save the file

      Thanks for any help.








      Messages in this topic (3)
      ________________________________________________________________________
      2b. Re: First line of text to file name??
      Posted by: "Don" don@... dpasseng
      Date: Thu Dec 2, 2010 12:12 pm ((PST))

      Quick and dirty, something like this:
      ^!Find ^(.{1,20}) TIWRS
      ^!Set %filename%=^$GetSelection$
      ^!Save As "^%filename%.txt"


      On 12/2/2010 3:02 PM, Ryck Lent wrote:
      > I have been searching for a simple clip button to turn the first line of a
      > document into the file name. This would be similar to a function in Word that
      > proposes the first line as a possible file name when saving the first time.
      >
      > Does anyone know if such a clip button function exists already?
      >
      > The button function would:
      >
      > Select some n of the characters of the fist line of the file
      > Save the selected characters in a variable
      > Activate the file "Save As" function
      > Paste the stored variable into the file name box
      > Prompt or confirm file save location
      > Save the file
      >
      > Thanks for any help.
      >
      >
      >
      >
      >
      > ------------------------------------
      >
      > Fookes Software: http://www.fookes.com/
      > NoteTab website: http://www.notetab.com/
      > NoteTab Discussion Lists: http://www.notetab.com/groups.php
      >
      > ***
      > Yahoo! Groups Links
      >
      >
      >
      >





      Messages in this topic (3)
      ________________________________________________________________________
      2c. Re: First line of text to file name??
      Posted by: "John Shotsky" jshotsky@... shotsky1
      Date: Thu Dec 2, 2010 12:30 pm ((PST))

      I have a clip to do that. Many text files have characters that are not permitted

      in file names, like colons, slashes,
      etc. It's easy enough to capture some characters in a line, but then you have
      to convert the illegal ones to permitted
      file name characters. Mine simply changes all such characters to underscores. My

      code is not elegant, but it works, and
      is seldom used. Improvements welcomed.
      ;=====
      ^!IfFalse ^$IsAltKeyDown$ RUN
      ^!Info [L]This clip saves a file using the first line of text as a file name.
      ^PIllegal file name characters are removed
      from a copy of the first line.^PThe document is saved to NoteTab's default 'new
      document' folder.
      ^!GoTo End
      :RUN
      ^!Jump Doc_Start
      ^!Replace "\A\R*(..+)\R" >> "$1\r\n$1\r\n" HRS
      ^!Jump Doc_Start
      ^!Select Line
      ^!Replace "^(.+)[\/\?\<\>\\\:\*\|\"](.+)\R" >> "$1_$2\r\n" HRS0
      ^!IfError Next Else Skip_-3
      ^!Jump Doc_Start
      ^!Select Line
      ^!Set %RenameDoc%=^$GetLine$
      ^!Save as ^%RenameDoc%.txt
      ^!Jump Doc_Start
      ^!Replace "^(..+)\R" >> "" HRS
      ^!Save
      :End
      ;=====

      Regards,
      John
      <http://recipetoolz.com/> http://recipetoolz.com

      From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of
      Ryck Lent
      Sent: Thursday, December 02, 2010 12:02 PM
      To: ntb-clips@yahoogroups.com
      Subject: [Clip] First line of text to file name??


      I have been searching for a simple clip button to turn the first line of a
      document into the file name. This would be similar to a function in Word that
      proposes the first line as a possible file name when saving the first time.

      Does anyone know if such a clip button function exists already?

      The button function would:

      Select some n of the characters of the fist line of the file
      Save the selected characters in a variable
      Activate the file "Save As" function
      Paste the stored variable into the file name box
      Prompt or confirm file save location
      Save the file

      Thanks for any help.



      [Non-text portions of this message have been removed]






      Messages in this topic (3)



      Fookes Software: http://www.fookes.com/
      NoteTab website: http://www.notetab.com/
      NoteTab Discussion Lists: http://www.notetab.com/groups.php

      ***


      ------------------------------------------------------------------------
      Yahoo! Groups Links



      ------------------------------------------------------------------------
    • Show all 6 messages in this topic