Contact Us

Use the form on the right to contact us.

You can edit the text in this area, and change where the contact form on the right submits to, by entering edit mode using the modes on the bottom right. 


Portland, OR, 97209
USA

IMG_0189 (1).JPG

Blog

bevkjbvkbdkdxoeoziejdoiehz fiugebfuyegwi

Filtering by Tag: journaling

Script to add a selfie every day to Day One

James Kellerman

I was looking over an old backup when I came across a series of photos that I had taken as part of a picture a day project. Looking back on the photos was interesting; the different places, clothes and hairstyles that are the boring minutae of most days are rendered fascinating by their setting in a sequence. These were all ungaurded moments that reminded moI liked the photos but I wanted a better place to put them. Day One seemed like the perfect answer I was alredy using it for journaling and it supports a great command line interface.

What does it do? Snaps a photo at startup from your macbookpro camera and at 9:30 every morning. It then saves that image to a folder using the date for the filename and posts it to your day one journal.

What does it need to work

ImageSnap A comman line utility for taking pictures with the built-in isight camera. The easiest way to install this is via homebrew: brew install imagesnap

Day One A fantastic journaling application

Day One Command Line Tools Command line tools for Day One

Once you have all these installed you can use the following simple script to link it all together.

#!/bin/bash    


# The file name here we are using the date in Y-M-D format
FILE=$(date +"%Y-%m-%d").jpg

# the image path to save the image
IMAGEPATH=/Users/jkellerman/Dropbox/Images/me/


FILEPATH="$IMAGEPATH$FILE"


# Snap the photo
/usr/local/bin/imagesnap "$FILEPATH"

# Add the iamge to dayone
echo "Daily Image" | /usr/local/bin/dayone -j="path to dayone journal" -p="$FILEPATH" new

# Sleep to stop lauchd thinking we are just dying
sleep 10s

The last thing you need is a launctl plist file that tells the script when to run. Here is the one I am using to run the script every day at 9:30am. This lives in /Library/LaunchDaemons/

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN
http://www.apple.com/DTDs/PropertyList-1.0.dtd >
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.example.exampled</string>
<key>ProgramArguments</key>
<array>
<string>/bin/sh</string>
<string>/Users/jkellerman/scripts/isighttodayone.sh</string>
</array>

<key>KeepAlive</key>
<false/>

<key>RunAtLoad</key>
<true/>

<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>9</integer>
<key>Minute</key>
<integer>30</integer>
</dict>


</dict>
</plist>