Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
html file names (Read 7652 times)
AsafKeller
Full Member
*
Offline



Posts: 77

html file names
Sep 10th, 2009, 8:24am
 
When exporting notes as html, the titles of the individual exported files retain the name of the original note, but spaces between words in the title are lost. I understand the utility of this for html codes, but can is it possible to have the file names retain these spaces?
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: html file names
Reply #1 - Sep 10th, 2009, 9:55am
 
Not at present; we judged that the potential for confusion with server issues exceeded the advantage of retaining spaces in file names.

This might be a decision worth revisiting; when we originally made it, only the most technical of technical people understood urls like http://example.com/a%20space.html , and the %20 would frighten the children.  Nowadays, perhaps everyone is comfortable with this.
Back to top
 
 
WWW   IP Logged
AsafKeller
Full Member
*
Offline



Posts: 77

Re: html file names
Reply #2 - Dec 14th, 2009, 9:10am
 
Is there, then, an action/macro I can use to replace all the spaces in my existing notes titles with something like an underscore?
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: html file names
Reply #3 - Dec 14th, 2009, 10:18am
 
If you want to change all the $Name values inside your TBX, you be best off using the command line via runCommand() and something like the  'tr' utlity.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
AsafKeller
Full Member
*
Offline



Posts: 77

Re: html file names
Reply #4 - Dec 14th, 2009, 10:56am
 
Thanks. Unfortunately, I have little or no idea what you wrote. Any help would be much appreciated!
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: html file names
Reply #5 - Dec 14th, 2009, 11:18am
 
Try this on a test file first - there's no undo for this sort of thing!

Create an agent:
Query: Name( )    <-- N.B. a space character between the ()
Action: $Name=runCommand("echo "+$Name+"| tr ' ' '_'");

The agent will find all notes with one or more spaces in the title ($Name).  The 'tr' command line utility translates all spaces (or sequences of spaces) into a single underscore - i.e. two spaces in a row become a single underscore.

So a note named "This note name has    spaces" will match the agent, get renamed "This_note_name_has_spaces" and no longer match the agent so the actual command line is only run one on each note needing rename.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
AsafKeller
Full Member
*
Offline



Posts: 77

Re: html file names
Reply #6 - Dec 14th, 2009, 1:53pm
 
Brilliant; thanks much!
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print