# Johnny Decimal... and automatic filing?

**URL:** <https://discourse.devontechnologies.com/t/johnny-decimal-and-automatic-filing/69573>\
**Category:** Automation\
**Created:** [February 14, 2022, 4:25pm UTC](https://discourse.devontechnologies.com/t/johnny-decimal-and-automatic-filing/69573 "2022-02-14T16:25:59Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![NationalInterest](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/n/3bc359/32.png) [@NationalInterest](https://discourse.devontechnologies.com/u/NationalInterest)\
**Post date:** [February 14, 2022, 4:25pm UTC](https://discourse.devontechnologies.com/t/johnny-decimal-and-automatic-filing/69573/1 "2022-02-14T16:25:59Z")

</div>

Does anyone here use the Johnny Decimal filing system, or some variant of it?

> **[Home](https://johnnydecimal.com)**
>
> A system to organise projects.

Would it be possible to write a script that automatically files if the filename included the decimal? e.g., File “12.03 Secondary May 2022 payroll extract.xls” would get automatically filed to folder “12.03 Payroll 2022” based on “12.03”.

---

<div class="post-metadata">

**Author:** ![DTLow](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/dtlow/32/18161_2.png) [@DTLow](https://discourse.devontechnologies.com/u/DTLow)\
**Post date:** [February 14, 2022, 4:43pm UTC](https://discourse.devontechnologies.com/t/johnny-decimal-and-automatic-filing/69573/2 "2022-02-14T16:43:51Z")

</div>

> [@NationalInterest](#):
>
> Would it be possible to write a script that automatically files if the filename included the decimal? e.g., File “12.03 Secondary May 2022 payroll extract.xls” would get automatically filed to folder “12.03 Payroll 2022” based on “12.03”.

An Applescript should be able to handle this  
I use a script to assist in processing Inbox records; it moves the record out of the Inbox  
Sample at [Moving Inbox Notes to specific folders in my DB - #7 by DTLow](https://discourse.devontechnologies.com/t/moving-inbox-notes-to-specific-folders-in-my-db/64441/7)  
Start coding, and let us know if you run into problems

btw What happens if a record fits multiple categories?  
I prefer tags over a folder structure - for example, tag _12.03Finance/Payroll/2022_

In Devonthink, tags are also groups (folders)  
With tag 12.03Finance/Payroll/2022, we get group/folder 12.03Finance/Payroll/2022

For context, I reflect tags in my naming standard; something like  
_2022-02-14 Reference [Secondary May 2022 payroll extract] 12.03Finance/Payroll/2022_

Thanks for the Johnny Decimal link.  
It’s quite informative and I’m revising my organization structure

---

<div class="post-metadata">

**Author:** ![Jayboux](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/j/a9a28c/32.png) [@Jayboux](https://discourse.devontechnologies.com/u/Jayboux)\
**Post date:** [February 14, 2022, 5:13pm UTC](https://discourse.devontechnologies.com/t/johnny-decimal-and-automatic-filing/69573/3 "2022-02-14T17:13:39Z")

</div>

I’m curious to hear other opinions as well. I started organizing all my files in a customized JD fashion. Though I came across DTP3 during that time, and am currently establishing my DT workflows.

---

<div class="post-metadata">

**Author:** ![NationalInterest](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/n/3bc359/32.png) [@NationalInterest](https://discourse.devontechnologies.com/u/NationalInterest)\
**Post date:** [February 14, 2022, 5:27pm UTC](https://discourse.devontechnologies.com/t/johnny-decimal-and-automatic-filing/69573/4 "2022-02-14T17:27:32Z")

</div>

> [@DTLow](#):
>
> btw What happens if a record fits multiple categories?  
> I prefer tags over a folder structure.

It’s not a huge concern for me - having broad categories helps. If it came to it, I could replicate a file in DT into multiple folders - the filename would identify the ‘main’ category.

I do use tags to add detail to a record (e.g., I might add a scripture reference to a document to help with search if it’s not explicitly identified). However, I use documents outside of DT on other devices and there is the (unlikely) possibility I could end up on another operating system in the future. Tags might not be supported by another application or operating system. Folders will.

---

<div class="post-metadata">

**Author:** ![MsLogica](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/mslogica/32/23244_2.png) [@MsLogica](https://discourse.devontechnologies.com/u/MsLogica)\
**Post date:** [February 14, 2022, 6:09pm UTC](https://discourse.devontechnologies.com/t/johnny-decimal-and-automatic-filing/69573/5 "2022-02-14T18:09:03Z")

</div>

Thank you so much for this post!! I knew I’d read of some kind of filing system with a generic American name, and I tried all sorts of weird combinations (Paul Decimal, Barry Decimal, etc.) and I never found it. It was this!!

Because I couldn’t find what I’d once read about, I implemented a numerical system from what I could remember, which actually seems vaguely similar (thanks brain).

I use:  
10. Apples  
20. Pears  
30. Oranges  
40. Grapes  
Etc. (I actually only have 4 top level folders but I have space for 9 in this system).

Then within those top folders, I did the same again:  
10.01. Granny Smith  
10.02. Red Falstaff  
10.03. Cox  
10.04. Pippin

That’s as far as my system goes.

I have noticed myself now thinking “this file goes in 10.02.” Which is either amusing or stupid and I should’ve used Dewey decimal or something so it actually meant something to someone other than me 🙄

---

<div class="post-metadata">

**Author:** ![NationalInterest](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/n/3bc359/32.png) [@NationalInterest](https://discourse.devontechnologies.com/u/NationalInterest)\
**Post date:** [February 14, 2022, 6:16pm UTC](https://discourse.devontechnologies.com/t/johnny-decimal-and-automatic-filing/69573/6 "2022-02-14T18:16:29Z")

</div>

Looks good… and you shouldn’t have a problem finding fruit. 🙂

Also found this, which feels like a hybrid of folders and tagging - but including ‘secondary categories’ in the filename. [How to Organize Your Files: An Introduction to Personal File Management - The Mac Observer](https://www.macobserver.com/tips/deep-dive/intro-to-pim/) The author suggests a numerical system could work too, which makes sense. Again, hopefully I could automate filing with DT. I’m not sure what the benefit of separating by file type, except perhaps for tidyness.

---

<div class="post-metadata">

**Author:** ![MsLogica](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/mslogica/32/23244_2.png) [@MsLogica](https://discourse.devontechnologies.com/u/MsLogica)\
**Post date:** [February 14, 2022, 6:36pm UTC](https://discourse.devontechnologies.com/t/johnny-decimal-and-automatic-filing/69573/7 "2022-02-14T18:36:28Z")

</div>

> [@DTLow](#):
>
> btw What happens if a record fits multiple categories?  
> I prefer tags over a folder structure.

In my (vaguely similar) system this isn’t a problem. My top level folders (“groups” 😬) use relatively immutable categories for my fields of interest (I crossed checked it with the Dewey list to make sure I was choosing top level and not just what I felt was top level, so “earth sciences” instead of “geology”). I have subfolders inside them that are more defined, so eg I’d have:

1. Earth Sciences  
10.01. Geology  
10.02. Climate science  
10.03. Ecology  
10.04. Specific niche interest 1  
10.05. Specific niche interest 2

Etc. If something fits in more than one subfolder (fairly common in earth sciences!), I just put it in the top folder and not one of the subfolders. So if something is both geology and climate science, it might just end up in the “10. Earth Sciences” folder rather than being subcategorised. Hopefully that makes sense.

I don’t file my bills in DT, but I guess if I was doing similar for that I’d have:

1. Bills  
20.01. House  
20.02. Car  
20.03. Tech

Or whatever, and all the misc ones would just go in “20. Bills”.

Edited as I realised an error with my numbering.

---

<div class="post-metadata">

**Author:** ![tdmayca](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/t/c0e974/32.png) [@tdmayca](https://discourse.devontechnologies.com/u/tdmayca)\
**Post date:** [February 14, 2022, 8:09pm UTC](https://discourse.devontechnologies.com/t/johnny-decimal-and-automatic-filing/69573/8 "2022-02-14T20:09:24Z")

</div>

I just completed a project using Smart Rules that could use some of the same principles to achieve what you have in mind. My goal was to find a way to rename documents within DT3 using the automation feature within Smart Rules and it worked very well. I used the “Scan Name” function which uses the AppleScript’s Regular Expression syntax for identifying and selecting digits. Once I had parsed the existing name, I was then able to rename the document title to my liking, retaining the existing text in the name but assigning a preferred date convention at the front of the name (yyyy-mm-dd, vs. my existing conventions of yyyymmdd or mmddyy). In your case, your next action in your Smart Rule would be to search for the group with the digits you’re looking for and then filing the document automatically. If you’re interested, I can point you to the part of the documentation that describes this approach.

---

<div class="post-metadata">

**Author:** ![DTLow](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/dtlow/32/18161_2.png) [@DTLow](https://discourse.devontechnologies.com/u/DTLow)\
**Post date:** [February 14, 2022, 8:39pm UTC](https://discourse.devontechnologies.com/t/johnny-decimal-and-automatic-filing/69573/9 "2022-02-14T20:39:46Z")

</div>

> [@tdmayca](#):
>
> uses the AppleScript’s Regular Expression syntax for identifying and selecting digits

Could someone give details on this  
My regex skills are poor (none)  
I use plain applescript code; it’s do-able but more complex  
. passing through the characters looking for “.” and confirming nn.nn

---

<div class="post-metadata">

**Author:** ![tdmayca](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/t/c0e974/32.png) [@tdmayca](https://discourse.devontechnologies.com/u/tdmayca)\
**Post date:** [February 14, 2022, 9:33pm UTC](https://discourse.devontechnologies.com/t/johnny-decimal-and-automatic-filing/69573/10 "2022-02-14T21:33:59Z")

</div>

I’m posting a link to a DT Community post that proved very helpful to me to learn what I needed to write Smart Rules that I used to edit and replace document names in my database. Take a look. [Smart Rule wildcards - #16 by chrillek](https://discourse.devontechnologies.com/t/smart-rule-wildcards/60404/16)  
Note: chrillek’s post contains a clip from the documentation that includes a link to the Regular Expression syntax table.

---

<div class="post-metadata">

**Author:** ![tdmayca](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/t/c0e974/32.png) [@tdmayca](https://discourse.devontechnologies.com/u/tdmayca)\
**Post date:** [February 14, 2022, 9:56pm UTC](https://discourse.devontechnologies.com/t/johnny-decimal-and-automatic-filing/69573/11 "2022-02-14T21:56:19Z")

</div>

For illustration purposes, I will describe for you the process of writing a Smart Rule that automated the renaming of document names in a clearer format. Specifically, for several years I used the following date convention to name my files imported into DT3: “YYYYMMDD Document Name”. For better clarity, I wanted to “batch rename” documents with this convention to read “YYYY-MM-DD Document Name”. Of course, I could manually edit these names, but why do that if automation within DT could do the trick. I wrote the following Smart Rule, to be applied “on demand” once I had the folder (or group of folders) I wanted set properly in the Smart Rule:

 ![Smart Rule - Renaming Date and Subject](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/3X/d/0/d0adcfac9ecec7557b9c071ec4621b7f8f2e7dcd.png)

The Action “Scan Name” looks for a “Regular Expression” with the syntax shown, where:

1. (\d{4}) represents the first four digits in the document name (the “year” string\_
2. (\d\d) represents digits 5 and 6 (the “month” string")
3. (\d\d) represents digits 7 and 8 (the “day” string")
4. (.\*) represents the text string (in this case, “Document Name”)  
The next action is “Change Name” that interprets and reassembles the expression that was parsed in the previous action by using the following syntax:
5. \1 refers to the first bracketed group (\d{4}) and places a “-” between each of the next groups of digits (\2 and \3), followed by a space and then the preserved text string (\4).

After creating this Smart Rule, I proceeded to make 4 additional ones to deal with other past conventions such as:  
“MMDDYY Document Name”  
“Document Name MMDDYY”  
and so forth.

Make Sense?

---

<div class="post-metadata">

**Author:** ![stephenjw](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/s/c37758/32.png) [@stephenjw](https://discourse.devontechnologies.com/u/stephenjw)\
**Post date:** [February 15, 2022, 3:30am UTC](https://discourse.devontechnologies.com/t/johnny-decimal-and-automatic-filing/69573/12 "2022-02-15T03:30:29Z")

</div>

> [@DTLow](#):
>
> Could someone give details on this

This site was recommended on one of the older posts on this forum and is a really good regex primer: [http://rexegg.com](http://rexegg.com).

---

<div class="post-metadata">

**Author:** ![BLUEFROG](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/bluefrog/32/135_2.png) [@BLUEFROG](https://discourse.devontechnologies.com/u/BLUEFROG)\
**Post date:** [February 15, 2022, 5:42am UTC](https://discourse.devontechnologies.com/t/johnny-decimal-and-automatic-filing/69573/13 "2022-02-15T05:42:34Z")

</div>

That is a deeeeep dive but a great resource. Nice to see it mentioned.

---

<div class="post-metadata">

**Author:** ![chrillek](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/chrillek/32/29340_2.png) [@chrillek](https://discourse.devontechnologies.com/u/chrillek)\
**Post date:** [February 15, 2022, 11:21am UTC](https://discourse.devontechnologies.com/t/johnny-decimal-and-automatic-filing/69573/14 "2022-02-15T11:21:38Z")

</div>

Just to clarify: There’s no such thing as “AppleScript Regular Expression syntax” – AS has not even the faintest notion of REs. What’s used here is the [ICU RE syntax](https://unicode-org.github.io/icu/userguide/strings/regexp.html).

In addition to rexegg, I’d like to mention [regex101.com](http://regex101.com) It is not a learning resource but a great tool to check your REs against your text. And then there’s of course [Jeffrey Friedls book on REs](http://regex.info/book.html). Incredibly helpful, but maybe not the best starting point.

---

<div class="post-metadata">

**Author:** ![NationalInterest](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/n/3bc359/32.png) [@NationalInterest](https://discourse.devontechnologies.com/u/NationalInterest)\
**Post date:** [February 15, 2022, 3:37pm UTC](https://discourse.devontechnologies.com/t/johnny-decimal-and-automatic-filing/69573/15 "2022-02-15T15:37:20Z")

</div>

Many thanks for the ideas, particularly around the use of regex.

> [@NationalInterest](#):
>
> Also found this, which feels like a hybrid of folders and tagging - but including ‘secondary categories’ in the filename. [How to Organize Your Files: An Introduction to Personal File Management - The Mac Observer](https://www.macobserver.com/tips/deep-dive/intro-to-pim/)

I’ve tried this, and was able to create a smart rule to automatically file based on a leading category in a file name e.g., “[Test][Technical] My test file.docx” was instantly filed to folder [Test]/2022.

Good so far, but then I realised are special characters in DT, so searching for [Technical] in a file name doesn’t return meaningful results (it works great at finder level). So I either find another character, or go with JD numbering - but I think that would require AppleScript (to translate 10.02 into 10.02 Accounting Files by finding the matching folder, which I’d have to find time to learn.

---

<div class="post-metadata">

**Author:** ![system](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/2X/4/4e6ff70c96be2eb307a274d890bba8d71ba671b3.png) [@system](https://discourse.devontechnologies.com/u/system)\
**Post date:** [February 14, 2025, 3:37pm UTC](https://discourse.devontechnologies.com/t/johnny-decimal-and-automatic-filing/69573/16 "2025-02-14T15:37:44Z")

</div>

This topic was automatically closed 1095 days after the last reply. New replies are no longer allowed.
