Day One import shell script - need help

I need a hand converting this shell script to work with Hazel, so I can import .txt files to the Day One app:
More info here: http://dayoneapp.com/tools/ - there might be a better way to do this than the script I found. The suggested code from the developers for importing a note.txt file seems simpler:
My goal is to save text files in a folder, files named "2013-03-08 3:35 PM.txt" with the contents of the file added as the body of the entry. I can tweak the file name if necessary. I have the Day One CLI tools installed.
Thanks!
- Code: Select all
# Part of the txt-to-dayone repository: https://github.com/christophersu/txt-to-dayone
IFS=$'\n'
files=$(ls | egrep '(.txt)')
for i in $files; do
created=$( GetFileInfo -d "$i" )
dayone -d="$created" new < "$i"
done
unset IFS
More info here: http://dayoneapp.com/tools/ - there might be a better way to do this than the script I found. The suggested code from the developers for importing a note.txt file seems simpler:
- Code: Select all
Creates a new entry using yesterday’s date with the specified text
$ ./dayone -d="03/03/2011 5:30PM" -s=true new < ~/Desktop/note.txt
My goal is to save text files in a folder, files named "2013-03-08 3:35 PM.txt" with the contents of the file added as the body of the entry. I can tweak the file name if necessary. I have the Day One CLI tools installed.
Thanks!