Class: CreateTask::Things

Inherits:
Helper
  • Object
show all
Defined in:
lib/create_task/things.rb

Overview

Creates a task in Things app

Class Method Summary collapse

Methods inherited from Helper

#default_parsed_date, new_task, #parse_date

Class Method Details

.create(args) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/create_task/things.rb', line 5

def self.create(args)
  `osascript << 'APPLESCRIPT'
     set d_date to date "#{args[:due_date]}"
     tell application "Things"
     set newToDo to make new to do with properties {name: "#{args[:name]}"}
      set newToDo's notes to "#{args[:due_date]}"
                set newToDo's due date to d_date
      set tag names of newToDo to "#{args[:tag]}"
    end tell
     APPLESCRIPT`
end