# Make a journal entry in Day One linked to this document

**URL:** https://discourse.devontechnologies.com/t/make-a-journal-entry-in-day-one-linked-to-this-document/15616
**Category:** Automation
**Created:** [April 14, 2013, 5:09pm UTC](https://discourse.devontechnologies.com/t/make-a-journal-entry-in-day-one-linked-to-this-document/15616 "2013-04-14T17:09:09Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![korm](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/k/e0b2c6/32.png) [@korm](https://discourse.devontechnologies.com/u/korm)
#### Post date: [April 14, 2013, 5:09pm UTC](https://discourse.devontechnologies.com/t/make-a-journal-entry-in-day-one-linked-to-this-document/15616/1 "2013-04-14T17:09:09Z")

</div>

[Day One](http://dayoneapp.com) is a useful light-weight journaling app for OS X and iOS. A command line interface (CLI) is [available for Day One](http://dayoneapp.com/tools/) users.

Here is a simple script that will create a journal entry in Day One with a notation about a selected document in DEVONthink. Select the document, run the script, enter whatever note you wish, and click OK. Day One uses Markdown syntax, so the new entry is Markdown-ified. The entry has a link-back URL to the selected document in DEVONthink. Journal entries with the link, and sync’d to Day One on iPhone or iPad, will open the document in DTTG if it has been synced from DEVONthink to DTTG.

```auto
(* Make a Day One journal entry linked to this document.

Use: select a document in DEVONthink and execute the script

REQUIRES: Day One must be installed on the computer, and the Day One CLI installed

Day One CLI: see http://dayoneapp.com/tools/

*)
property j_Prefix : ""

tell application id "DNtp"
	set theSelection to (the first item of (the selection as list))
	set d_Default to return & return & return
	set j_Header to "## " & j_Prefix & the name of theSelection & return & return
	set d_Prompt to "Notation about " & (the name of theSelection as string)
	set j_Note to text returned of (display dialog d_Prompt default answer d_Default with title "Make a note for Day One")
	set j_Link to "[See document](" & (the reference URL of theSelection as string) & ")"
	set j_Content to j_Header & j_Note & return & return & j_Link
	my makeJournalEntry(j_Content)
end tell

on makeJournalEntry(j_Content)
	
	set new_JournalEntry to "echo " & (quoted form of j_Content) & " | /usr/local/bin/dayone new"
	do shell script new_JournalEntry
	
end makeJournalEntry

```

If the Day One CLI is not installed, or is in a different location from /usr/local/bin/dayone, the script will fail silently.

---

_[View the full topic](https://discourse.devontechnologies.com/t/make-a-journal-entry-in-day-one-linked-to-this-document/15616)._
