Hi everyone,
I think this is my first post here, so I want to say hello, I hope everyone is well and enjoying the summer!
Secondly, I want to say how amazed I am how many things can be done with DEVONthink, and the know-how people are sharing on this forum is really appreciated, thanks for that!
I followed explanations by @Stephen_C on this topic: Importing from Day One: a reasonably definitive guide (really great ideas, thank you!)
But I noticed that only some of my files were renamed correctly by DEVONthink.
I tried to understand why and i couldnāt find any reason why some files get renamed and others donāt.
Does anyone know what can cause this?
Thanks in advance for your answers!
Warm regards,
Charlie
Could you be a bit more specific, Iād which files get renamed to what and which ones donāt?
Also, where does the date that you mention in the title come into play?
1 Like
Can you explain any variation from āmy processā that youāve followed, please? Itās difficult to see whatās going wrong without knowing the exact process because it used to work for me!
Since then Iāve substantially changed and improved my process so once I know exactly where itās tripping over I can probably assist with the ānewā process. (I can post the new process later but Iām just about to finish preparing late lunch here - accompanied by a very decent Chardonnay - so it may be a little time before I can type sensibly again! )
Stephen
1 Like
Welcome @charliecortial!
We are all doing well and staying as cool as possible on both sides of the pond. We hope the same for you.
Secondly, I want to say how amazed I am how many things can be done with DEVONthink, and the know-how people are sharing on this forum is really appreciated, thanks for that!
Indeed! DEVONthink is a very capable application and can be used in a variety of ways, both simple and complex.
1 Like
Thank you all for replying (and so fast)!
To @chrillek, sure, I can try to describe to the best of my ability.
I have 378 Day One entries that I want imported into DEVONthink, following the process outlined by @Stephen_C in the topic linked below.
The process works for me until the renaming of the markdown files. 287 entries donāt get renamed, and the 91 remaining entries do get renamed.
I canāt find any difference between them when I look at them with a text editor. I have no idea why some of them get renamed and others not. Some of the entries have a date in CET time, some in CEST time, it doesnāt seem to make a difference because some got renamed in each group.
You are right about pointing out that mentioning the date in the title is probably wrong. Itās just because the date itās what I tried to āextractā from the file with DEVONthink, but it seems itās not related to the date itself.
I donāt really know what else to describe.
To @Stephen_C : As far as I understand, I didnāt vary from the process you outlined at all. I literally followed step by step. I donāt really know what else to add to my description above. Just let me know if I should add something else.
Iām in no hurry, so please enjoy your Chardonnay
Hi @BLUEFROG, thank you, Iām trying to stay in cool places as well
It never ceases to amaze me how powerful DEVONthink can be, and how some users come up with amazing workflows!
Creating and bettering an app like that, my panana off to the DEVONtech team, itās really mind-boggling.
Thank you all for the time you take to answer me!
Warm regards,
Charlie
1 Like
Charlie:
Do you by any chance use the Hazel app? The whole thing is much easier, and vastly more automated, if you do. (If not, donāt worry, weāll still try to solve the problem you have.)
In DT select all the imported markdown files (i.e., excluding any photo folder), go to Tools > Batch Process and choose āChange Nameā to āOldest Document Dateā (which will pick up the creation date of each entry).
Does it, by any chance, work better if you choose āNewest Document Dateā?
(I ought some time update the old thread with my current procedureāwhich is much more automated and quicker.)
Stephen
1 Like
Hey @Stephen_C,
I have and sometimes uses Hazel, but Iām sure that, like DEVONthink, I severely under-use it.
No, I tried and it makes no difference if I choose any other placeholder like āNewest Document Dateā.
Thank you so much for your time and help!
Charlie
OK - letās try an updated version of the procedure. If this is too short or confusing in any way just post back here and Iāll try to explain more clearly later. Iām a little short of time just at the moment but I will later or tomorrow provide any help you need.
- Take a look at this link on the Hazel forumsāwhich explains my Hazel rules involved the procedure of extracting entries from Day One. Note I deal with the renaming of the imported records in Hazel.
- The relevant DEVONthink smart rule (applied on import) looks like this:
I move the imported entries to a Temp
group simply to check and apply any of the scripts mentioned in the penultimate paragraph below.
The script include in ithe smart rule is as follows:
on performSmartRule(theRecords)
tell application id "DNtp"
try
repeat with theRecord in theRecords
-- first we remove the extension from the record name
set theLongDateText to (name without extension of theRecord) as string
-- now we simply populate the custom metadata with the date text
add custom meta data theLongDateText for "diaryentrydate" to theRecord
-- ensure we have a blank line before the metadata
set theText to plain text of theRecord
set amendedText to return & theText
set plain text of theRecord to amendedText
end repeat
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
end try
end tell
end performSmartRule
The only purpose of the script in that rule is to create custom metadata (available only in the Pro edition of DEVONthink) with a date in the format (e.g., Sunday 7 August 2022.md
)āwhich allows sorting by date. (Of course, there are other ways of renaming the diary records so that they will sort automatically and correctly but I prefer to see datesāi.e., record namesāin a format I recognise immediately.)
This all sounds very long-winded but once itās set up itās all very quick and efficient. In addition, I use other scripts to add the weekday name to the date at the start of the imported entry, to convert Day One links to DEVONthink item links (with a little manual work involved in Day One) and to convert hashtags (which is what I use in Day One to ensure tags carry over to DEVONthink, having set the relevant preference in DEVONthink) to YAML front matter.
Iām happy to help with anything you need but if it starts involving the Hazel rules maybe we should take it to direct messages here so we donāt get too far off topic in this thread.
Stephen
Some time over the next couple of days Iāll try to write down more fully not only my current import procedure when getting entries from Day One into DEVONthink but will also supplement that by bringing together in the same thread the various scripts I use to enhance the imported entries.
Stephen
So, your records are named Sunday,ā¦
, Monday,ā¦
etc? When you sort them, donāt you get all the Mondays first, then all the Fridays, Thursdays,ā¦? Or I misunderstood you.
You are correct: each record is named in the format Sunday 7 August 2022.md
. Somewhere on this forum weāve briefly discussed this before and you did then intimate it was not particularly clever to do that. You are, of course, correct. It would have been more sensible to use a more standard, sortable format, like 2022-08-07.md
āso that records automatically sort properly within their year groups.
However, I now have just over 19,000 records with Hazel smart rules and a number of key scripts which depend upon that naming format so Iām not (currently) planning to change all of the record names. That explains why I use custom metadata to store the name of each record as a dateāenabling quick sorting on the date.
There was originally another issue in that export from Day One did not include the name of the weekday at the start of each diary record. Being able to see that at a glance from the record name was thus important. However, I now use a script on import of the entries which adds the weekday to the date in the heading of the record so have shot myself in the foot with that particular argument.
Stephen
I see. And the meta data field is of type date
, I guess. Apparently, DT automatically casts the string
you use in adding the metadata to a date
. I wasnāt aware of that and draw the wrong conclusion.
I wish formally to acknowledge that you have won. The āproperā format for date named records is clearly 2022-08-07
(i.e., name sortable format) so this morning I wrote a script and have since been somewhat involved in renaming my 19,000 diary records in DEVONthink.
It is a tribute to the superb robustness of DEVONthink that (after Iād most carefully checked, in preferences, Update name of item links automatically
) the many hundreds of links (effectively cross-references) within my diary records work perfectly notwithstanding the change of record names.
Now all that remains is for me to change all my other scripts that rely on the record names to reflect the new format. Thanks for the work!
Stephen
2 Likes
Wow. Congrats! I was actually thinking about mentioning the ārightā format again but decided against it because I assumed it would be too much work to change the dependent scripts.
In the end, the process should be a lot easier, I believe.
1 Like
Hi @Stephen_C, Iām writing to let you know Iām so sorry I couldnāt answer you sooner, and I want to thank you for your detailed answer.
I had very busy days and couldnāt find a moment to work on this.
I will try the new method your shared tomorrow and answer again.
Thank you so much for taking the time to share it with us
Best regards,
Charlie
@charliecortial please donāt worryāthereās no hurry, take your time and just post back here if you have problems. Even if I canāt help you there are many here who will be happy and able to help.
Stephen
Hi everyone,
Iām sorry for taking so much time to answer, I had a few busy days recently and little time to spend on this, but Iām always impressed how powerful tools like DEVONthink (and Hazel) can be.
@Stephen_C kindly helped me understand how parts of the feature set of Hazel was working in private messages, and itās quite impressive to see those tools working so well in tandem.
I also found this conversation between @chrillek and @Stephen_C about date formats to be quite interesting for choosing the right way to name things and avoid future difficulties when sorting files and folders.
I also tended to use a sortable format like YYYY-MM-DD over the years, so I mostly adapted the impressive rules and script that Stephen kindly shared with us.
Thanks to everyone that took the time to answer me, and I hope this thread can be useful to others!
1 Like
Is there a way for me to edit my first post?
I should change my title for it to better reflect the content of the thread.
Try clicking on the pen/pencil at the bottom of the post, Charlie. Thank you for the kind comments.
Stephen