Customise default new file name

Hi

When I create a new rich text file, the default name is
“New Rich Text 1” “New Rich Text 2”

I would like the new file name to be based on date or location of the file.

For example, files created on 7 Sep to be called.
"13.09.07 Rich Text 1" “13.09.07 Rich Text 2”

Also if I have a folder/Group called “Ideas”
The new file name in this group to be named
“13.09.07 Ideas 1”

I personally find this useful. because I rename all my files manually. It will be more convenient if it is done automatically.

Since this is a very specific preference – perhaps not likely to appeal to a broad group – a script that creates and names files and groups your way might be the best answer. Such scripts can be added to the toolbar. You’ll find examples and instructions elsewhere in the forum.

korm has it right. This is the perfect opportunity to roll your own .templatescriptd Template.

Actually this doesn’t require scripting, rich text templates containing %shortDate% or %groupName% in the filename will do this.

This is excellent.

You do this suggestion by placing an RTF file in ~/Library/Application Support/DEVONthink Pro 2/Templates.noindex that is named like this:

See the topic “Templates” in DEVONthink help for a further description of placeholders. Other possibilities are:

%time%: The current time
%date%: The current date
%shortDate%: The current date in short format
%longDate%: The current date in long format
%monthname%: The month name of the current date
%weekday%: The week day name of the current date
%day%: The day number of the current date
%month%: The month number of the current date
%year%: The year number of the current date
%username%: The user's name
%fullUsername%: The user's full name
%organization%: The user's organization from Address Book
%emailAddress%: The user's email addresses from Address Book
%host%: The host name
%databaseName%: The database name
%databasePath%: The database's path
%groupName%: The name of the parent group
%clipboard%: The clipboard contents as plain text
%styledClipboard%: The clipboard contents as rich text
%clipboardLink%: The clipboard contents as a clickable rich text link if the clipboard contains a valid URL

Results of the clipboard placeholders may not be useful.

1 Like

Thanks, Criss - I had missed the %groupName% argument and thought it would require defining a placeholder. Lesson one of the day, and still learning. :smiley:

Two things…

  1. The placeholder is case-sensitive, so %groupname% will note work. It’s %groupName%.

  2. The formatting of %shortDate% is taken from System Preferences > Language & Text > Region. Press the Customize button in the Dates section to redefine it, if desired.

Wow, thanks for the info on where to change the default time format. Very handy.
I’ve created a new note template with the %shortDate% placeholder as the name and moved it into the Toolbar folder in the templates folder. I’ve added it to the main toolbar which is very handy, but it would be nice if I could change the name of the toolbar shortcut to Journal instead of having it show up as %shortDate%. Any easy way to do this?

No, that’s not possible (without using template scripts).

I will try and report back. :slight_smile:

I name the template file as %shortDate%.rtf
It gives me file name like
13.09.10.rtf
but how can I add a sequence number like
13.09.10 2.rtf
13.09.10 3.rtf

Adding the sequencing would probably require some scripting. I don’t really care about the sequence because I use it to generate a dailey journal entry. I use that same note all day and just add a time stamp for each new entry.
I’ve been playing around trying to modify the existing Note template to generate a note with the short date plus weekday for a name while having the name “Journal” in the tool bar. No luck so far.

You can’t without scripting it, though you could add the time to the name since that will always be a unique value per day.