I want custom icons to appear on the records created from my custom templates. I have successfully created simple RTF templates and modified smart templates for my needs, but my custom icons do not show up when I create a new record from my templates.
Since there are various custom icons on DTP templates, am I missing something to make mine show up? The DTP Help page for the Info Panel mentions adding custom icons manually, I wanted to double check whether I can automate this step.
What DEVONthink does is copying the original file, that serves as the template to the database everytime you choose > Data > New from template. Therefore you have to change the icon of that original file - not in DEVONthink’s info panel, but in the Finder’s info window instead.
You will find the original templates here via > menu bar > Data > New from Template > Open Templates Folder.
Given you would want to change the icon for “Phone Note.dtTemplate”, you have to ctrl-click on the file and choose “show package contents” and - given you are using DEVONthink in English - have to navigate to /English.lproj/Phone Note.rtf. This is your original.
When I created my templates (smart and simple), I did exactly what you said. I even examined existing smart templates using Finder Info to see if any special flags needed to be set in addition to adding my custom icon. I used the Finder to add a custom icon to the original RTF file in the template (in the package contents for the smart templates). For the smart template, I even added a custom icon to the package so it would show up in the DTP template menu. The custom icon shows up in the DTP template menu (smart and simple), but not on any files created using my templates (smart or simple).
When I choose one of my templates (smart or simple) using “Data > New from template” to create a new record, only the rich text icon appears, not my custom icon. I used the DTP info panel to change only the icons of the files created by “Data > New from template” which showed up without the custom icon.
Trying to troubleshoot why DTP templates have working custom icons and my templates don’t, I even dug around in the DTP package contents looking at the icon resources to see if that’s how it worked, but I didn’t find the template custom icons, so I don’t think that’s how it’s done. Although I’m a software engineer, I’m not a Mac programmer, so there’s probably something I’m missing…
Next I’m going to investigate if it has to do with the format of the my custom icon files: .icns, .ico, etc.
The answer @berndm gave is the correct procedure. I have numerous custom icons on templates – all of which are applied in Finder Info as Bernd described. There is nothing in the DEVONthink app package that affects this – DEVONthink merely shows the icon that a file has in the filesystem.
What are your settings in DEVONthink > Preferences > Media? It’s possible that thumbnails are overriding your icons.
@seahunt, you’re speaking a lot about smart templates. I assume you are talking about smart groups. Please note, that smart groups change their icon depending on their criteria. A smart group showing e.g. “kind is pdf” will have the purple folder with the cogwheel on, but if you add a date criteria (“added today”) the icon will change to a clock symbol (/Applications/DEVONthink Pro Office/DEVONthink Pro.app/Contents/Resources/Clock.icns).
In order to find out, why your custom icons are not shown, my advice is to concentrate first on the issue with ‘simple’ templates like the phone note mentioned above.
korm’s idea is excellent. The only thing I can add, is to make sure, that it’s not a cache issue. Please delete DEVONthink’s cache (>menu bar > DEVONthink Pro Office > Empty Cache) and maybe restart not only the application but also your Mac.
The OP is referring to templates in ~/Library/Application Support/DEVONthink Pro 2/Templates.noindex that are packages (special folders) that can contain scripts and/or template documents that have placeholders for substituting text when a document based on the template is created. These include packages with extensions .dtTemplate and .templatescriptd. As noted by the OP, the template package can have a custom icon, and the template documents inside the package can have a custom icon. For example, see the Note.templatescriptd template that ships with DEVONthink.
There are also smart groups in that templates folder, we’re all speaking about: ~/Library/Application Support/DEVONthink Pro 2/Templates.noindex/Smart Groups/, which also have the extension “.dtTemplate”.
Should he have tried to customize these also, he might probably get confused by icons, which are dynamically distributed by DEVONthink depending on the criteria of the group. Therefore my post.
I didn’t mean to post and disappear, but a family emergency turned into a nightmare with no end in sight. I finally had a chance to look at the this today and I figured out how to fix my problem. I appreciate the help offered as it gave me ideas to investigate.
It turns out that I was using old icons which were less than 64x64 pixels in size. I had some icons which were working and some which weren’t. I chased several other possibilities before I determined that the maximum size of the icon in the source file determined whether it worked.
Since I don’t use a large icon view, and I couldn’t find satisfactory replacments for the too-small icons, I just used an app to scale the icon image size to 128x128. It’s out of focus in a large icon view, but it’s fine for my normal usage. I did test that 64x64 is sufficient, but I tried 128x128 first, so left mine at that size.
I now have both simple and smart templates consistently producing files with my custom icons, now.