GithubHelp home page GithubHelp logo

dolog's Introduction

DOLOG Script for Alfred.app

Swift 4.0 Twitter License: MIT

DOLOG is a script, written in Swift, that is used in an Alfred / workflow.

What it does

It takes an input string and creates an entry in the log journal of Day One with the content of the entry formated as completed task: plus the input string.

The idea is to be able to quickly log the tasks that you complete during the day with as little friction as possible. Many things can be logged automatically with IFTTT, but some things fall outside of the automation capabilities. This is for those tasks you complete.

Installation

You need a few things to make use of this script:

What you need
  • you need the latest version of Day One 2
  • you must have installed the Day One Command Line Interface with /Applications/Day\ One.app/Contents/Resources/install_cli.sh or following instructions from Day One CLI
  • you need to have Alfred installed, with a PowerPack license (required to use workflows)
Installation
  • download and unzip the dolog package.
  • double-click the .alfredworkflow file to install the workflow in Alfred.
  • open the workflow and double-click the external script module.
  • click the open workflow folder in finder button to the left of the cancelbutton. button
  • copy the DayOneLoggerPlus file from the dolog package to the workflow folder.
  • you can close the workflow folder and Alfred's preferences window.
  • you're good to go!

Usage

Invoke Alfred (for me this is ⌘-space), type dolog (although I can usually just type do) then return to select the workflow, then type the text you want to log, and press return.

Optional tags

The input string can include tags for the Day One entry. The format to use is the following:

-t tag1 tag_2 tag3 @ <completed task text>

To include tags, the input string must start with -t , followed by one or more space-separated tags, then the end of tags special character: @, then the text of the completed task.

To include spaces in tags, use the underscore _ character where the space should be and the script will convert those while processing the tags. For example, the following:

-t day_one @ something

Will create an entry with a tag day one

Default tags

All entries will have the completed tasks and the dolog tags added by default.

Swift version

This script is made for Swift 4.0.

Modifying the script

You can modify for example the default journal to log into, the default tags, etc. by modifying the script in the included DayOneLoggerPlus.swift file. You must then compile the script and make it executable and put it in the workflow folder.

How to contribute

I'm always happy to improve my code and learn, so if you find things to improve please submit a pull request.

Here are some ways you can contribute:
  • by reporting bugs
  • by writing or editing documentation
  • by writing code ( no patch is too small : fix typos, add comments, clean up * inconsistent whitespace )
  • by refactoring code
  • by closing issues
  • by reviewing patches
  • Submitting an Issue

I use the GitHub issue tracker to track bugs and features. Before submitting a bug report or feature request, check to make sure it hasn't already been submitted.

Submitting a Pull Request
  1. Fork the repository.
  2. Create a topic branch.
  3. Implement your feature or bug fix.
  4. Add, commit, and push your changes.
  5. Submit a pull request.

This is based on https://github.com/middleman/middleman-heroku/blob/master/CONTRIBUTING.md

License

Dolog is Copyright © 2017 Denis Ricard. It is free software, and may be redistributed under the terms specified in the LICENSE file.

About

I'm an iOS developer. You can find my web site at hexaedre.com, find me on Twitter under @hexaedre, or contact me.

dolog's People

Contributors

dricard avatar neberheim avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

neberheim

dolog's Issues

Adding to Journal with two word title

I’m not able to modify the Swift script to work with a journal name that has two words, in this case “Daily Log”
$ dayone2 --journal Daily Log --tags dolog completed\ tasks -- new "completed task: wrote a script" Error: Invalid value(s) for option -j, --journal: Daily, Log
Adding \ in the CLI was successful:
$ dayone2 --journal Daily\ Log --tags dolog completed\ tasks -- new "completed task: wrote a script" Created new entry with uuid: ####

Modifying the Swift script to let dayOneJournal = "Daily\ Log” resulted in:
~/Documents/GitHub/dolog/DayOneLoggerPlus.swift:17:28: error: invalid escape sequence in literal let dayOneJournal = "Daily\ Log”

I’m guessing I need to modify the replaceSpaces func or write a second one for the journal title, but I’m basically at my neophyte coding limit already.

Hide or close Terminal after process (enhancement)

Is it possible for the entry to work in the background? I don’t love that Terminal pops into the foreground and remains open. I tried messing around with && exit and some other commands but I’m not sure how to execute the process properly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.