Tags with special characters in them (#make_doc) are not recognized. E.g., #makedoc is recognized. I don’t think the parser should care as long as there are no spaces in the tag.
Tags with caps in them (#Outlook) are created as all lowercase (i.e., #outlook). The parser should not change case. E.g., #Jim_Neumann should not become #jim_neumann.
The next release will fix this, support underscores and won’t change the case (only if tagging is not case insensitive of course, see File > Database Properties)
@cgrunenberg is there any reason for convert hashtags to tags not showing up as an option in smart rule creation nor being available as a script in the Devonthink script folder? AFAIK the only way to activate it is importing a file to Devonthink or clicking in a specific menu option.
Also, would it be possible for it to interpret / in order to create nested tags? E.g. Parent Tag/Child Tag.
I totally agree we need this option.
Because DT don’t want to implement a real time md editor I bought a third party tool but for my use case this is almost useless when my tags are not getting updated. So either implement a real time editor or support features for using a third party app please.
Can I wait for this or do I need to find another solution?
It works fine now (as long as you’ve ticked the box as suggested by Bernado.
Presumably you’re indexing the folder so you can use the external program? It’s what I do with Emacs.
It now doesn’t matter whether you created the indexed document externally or within DT3: as soon as it’s indexed (almost immediately), the #hashtag will be converted to a DT3 (and finder) tag.
If you’re in DT3 in an existing document and you add or edit a #hashtag, and press cmd-s, the changes will appear in DT3’s tag bar. (NB you can’t do it the other way wrong – changes to the DT3 tag aren’t reflected in hashtags.)
I have already checked this box. I’m not using indexed folders but just double-click the document for editing in external application. When I save the document in the external application DT “recognizes” the changes immediately but the tags are not getting updated. They just getting updated if I (additionally) save the document within DT again.
This of course is working but that should not be the process.
I have to be sure that my documents are synchronized and up to date. You never can be sure if you have to handle it manual in two places.
It would be nice if import or re-index of edited md file took care of the tag conversion – so easy to forget to do the ‘convert hashtags to tags’ command.
Hmm, actually I am not good in apple script and don’t want another workaround that I need to develop and maintain myself on two devices.
Just for testing I created a simple rule “after save” for “markdown suffix” that should play a sound …but nothing happens - I’m not optimistic it’ll work with more complex stuff like that without lots of efforts.
Anyway, isn’t this an inconsistence behavior in DT that needs to be fixed ?
I’ve tried using the Assign Tags script which Christian mentions upthread – the idea being to use it within an hourly smart rule to tidy up any externally changed #hashtags as discussed in this thread.
It works – to a fashion. However, it also pulls in any word which happens to match an existing tag anywhere in the database.
E.g. create a new file with the title New Markdown and in the text write #test1 and #test2. The script picks up #test1 and #test2 and makes tags out of it, but it also picks up the word Markdown in the title and adds that as as a tag (because I already have a tag called ‘markdown’).
I’ve tried removing the ‘with existing tags’ from the relevant line leaving
set theTags to extract keywords from record theRecord with hash tags
but then it doesn’t pick up anything at all.
The original script is:
property pMaxTags : 5
on performSmartRule(theRecords)
tell application id "DNtp"
repeat with theRecord in theRecords
set theTags to extract keywords from record theRecord with existing tags and hash tags
set n to count of theTags
if n > 0 then
if n > pMaxTags then set n to pMaxTags
set tags of theRecord to (parents of theRecord) & (items 1 thru n of theTags)
end if
end repeat
end tell
end performSmartRule
How do I amend it to work the same way as the Data > Tags > Convert Hashtags to Tags menu command?
I don’t see any issue removing the existing tags from that line.
on performSmartRule(theRecords)
tell application id "DNtp"
repeat with theRecord in theRecords
set theTags to extract keywords from record theRecord with hash tags
set n to count of theTags
if n > 0 then
if n > pMaxTags then set n to pMaxTags
set tags of theRecord to (parents of theRecord) & (items 1 thru n of theTags)
end if
end repeat
end tell
end performSmartRule
I made exactly the change you did and it didn’t work – nothing happened to the DT tags when I deleted them and tried to recreate them with the script.
Then I read your post and it did work ten times on the run – except for the couple of times in the middle when it didn’t. I really can’t discover what the difference is between those times, unless it was that I ran the rule immediately after deleting the tags for the ones that didn’t work and waited a few seconds longer on the others…
Oh well, another mystery… I’ll use this and run the occasional cmd-a data>tags>convert when I remember.