Class: CreateTask::Things

Inherits:
Object
  • Object
show all
Defined in:
lib/ExtraCare2OF/services.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Things

Returns a new instance of Things.



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/ExtraCare2OF/services.rb', line 96

def initialize(args)
  name = args[:name]
  due_date = args[:due_date]
  notes = args[:notes]
  tags = args[:tag]
  remind = %x{osascript << 'APPLESCRIPT'
              set d_date to date "#{due_date}"
              tell application "Things"
              set newToDo to make new to do with properties {name: "#{name}"}
                set newToDo's notes to "#{notes}"
                set newToDo's due date to d_date
                set tag names of newToDo to "#{tags}"
              end tell
              APPLESCRIPT}
end