Recently, I posted asking for suggestions on naming and organization of files, with my proposed file naming scheme. I got a lot of useful feedback which helped my thinking quite a bit, so I thought (since I always enjoy reading about how others have approached this problem) I would do a follow up post on where I am in my organization and thinking so far.
I have decided on a scheme for file and folder naming that is a big change from my previous approach. I used to name many files in the format of “some text .ext” where date was in the format of yyyy.mmdd. I tend to do a reasonable amount of work at the terminal shell, and for those who also do so, you know that spaces in filenames can be a real problem with bash scripting. I was also thinking about prefixing files with the date rather than post-fixing for sorting purposes, although I was on the fence about that. I also tended to haphazardly name folders with, with spaces and other punctuation in the names as well.
After some consideration, I decided to go with a naming scheme for files in the format of “yyyy-mmdd-hhmmss_filename.ext”. The hhmmss part is optional, and the filename can be multi word, with all words separated by underscores. The helpful part here is that parsing filenames in scripts becomes much easier with a standard format; the date/time can be parsed off at the first underscore and the extension at the only period in the name. Filenames are all in lowercase.
This is not a hard and fast rule; some files have no date/time prefix depending on location and purpose, but I will follow the rule of no embedded spaces or periods (except before the extension) to parsing can still be done easily if needed.
Folders will all be done in CamelCase (but with the first C in Camel capitalized in contrast to the usual programming convention) and with no embedded spaces or punctuation.
I find that old habits die hard, and so I still wind up creating a lot of files with the name in my old format, and messing up folder name creation as well. As a result, I wrote two scripts, one of which fixes filenames and the other fixes folder names. The filename fixer is smart enough to detect the date at the end of the filename and move it to the front, reformat spaces and other punctuation, etc. It has switches that allow me to specify that if there is no date in the filename, add a specified date (or today or now as keyword shortcuts) or pull out the creation date from the file’s metadata instead. Both scripts take a filename and output a filename, and so basically serve as “filters” which can be embedded in shell scripts, called by other programs, used in scripts by Keyboard Maestro, or by Hazel, so they are versatile. In this manner I have embedded the “smarts” in one script which everything else can use in common. Hazel can watch a folder, for example, and rename files to the correct format getting the fixed filename from the script.
I adopted one suggestion from the earlier thread to keep my folder hierarchy much shallower than I had before, and have restructured folders quite a bit. This is working well; it’s much easier to see what is there with a longer list at the top level rather than having things buried (and so hidden) multiple levels deep.
I also spend some time rereading the old posts from Brett Terpstra on his “tagfiler” program, and after a lot of experimentation and trial and error, basically found that his scheme was better than any alternative I tried out. Under this concept, I have designated a few “top level” folders where I store things. He calls them contexts, I just see them as areas where I file things for different purposes. Those folders are tagged with a “context tag” starting with an equal sign. Under each area, folders can have a tag with an “@“ sign first character which is basically a short cut down to that part of the folder hierarchy.
Files get a context tag which tells which folder hierarchy they belong to, and what I call a “path tag” which is colon separated tags that basically chain the file down the folder hierarchy to its desired place. These two tags allow automatically filing into the folder tree.
I won’t go further into how this all works as I wound up very closely following Brett’s approach so you can, if interested, read it all there. I did write my own filing script to do all this, partly because I wanted to fine tune or adjust a few things, and partly because I just like to do that. This filing script again can be used by Hazel to gather up files from a common “Dispatch” folder for automatic filing once the tags have been applied.
I also use a relatively sparse bunch of additional single-word tags that add additional context, such as my name, my wife’s name, kids names, etc, and other topics (like house, manual, photography, etc) to help with searching.
I adopted a convention that “context” tags start with an equal sign and are a single work, first letter capitalized, just as Brett specified, and the context tag applied to a file to get it to be filed away is the same work but starting with # instead of =. Tags on folders to make shortcuts start with an @ and first letter capitalized as well. When a tag is created on a file, however, it is all lower case. This is, I think, identical to what Brett specified so I think I followed his scheme pretty closely. There are a lot of advantages to this scheme when it comes to searching for things with Spotlight which he describes very well.
I realized that one useful feature is that when you are tagging a file, the autocomplete in Finder is very helpful when you are trying to get a file to go to a common location. So if I had a file with a path tag of a:b:c because it was in a sub folder path of Context/a/b/c; typing “:a” and being able to autocomplete is very helpful. However, sometimes the first file to arrive in a folder was simply dragged there. If I could easily create the tags that woudl have automatically moved the file there with the auto filing script, then autocomplete can be used for future files that also need to go there. Accordingly, I have a script that looks at a given file, figures out the tags that would have gotten the file there (going up the folder tree and checking folder names and tags on folders that indicate shortcuts and context) and then creating those tags for the file. This is handy for creating a folder somewhere, dragging a file to it and using this script to create the tags that are later applied to other files using autocomplete.
Having just watched David’s Keyboard Maestro field guide, I have developed a renewed interest in playing with Keyboard Maestro, so I now have a palette that is opened with the “META” key, and which allowed me to apply the autofile, tagged, file renamer and folder renamer to the files or folders selected in Finder, making it very fast and convenient. For example, I need to create several sub folders, I just create them, type the name in all lower case with spaces between words, select them all and run the macro from the palette to convert them all to CamelCase, making typing much easier but keeping my system consistent.
I am now working on renaming files throughout my filing system, piece by piece as I come across areas to work on. I have another script that can recursively go down an entire folder tree and rename all of the files with the new scheme, but will probably run it very selectively over time as I see how all this works out.
And that, after far too long a post, is where i am and what I have been working on since my last post on the topic. At the least I had fun writing these various scripts over the past few nights, and I feel that consistency of organization and naming will be a benefit in the long run.
Now to think about whether I want to fire up DEVONThink again after a long absence and index some of these folders …