Class: OmnifocusMcp::Tools::Generators::EditItem
- Inherits:
-
Object
- Object
- OmnifocusMcp::Tools::Generators::EditItem
- Defined in:
- lib/omnifocus_mcp/tools/generators/edit_item.rb
Overview
Defined Under Namespace
Classes: Edited
Class Method Summary collapse
-
.call(params) ⇒ Object
Run the generated AppleScript against OmniFocus and parse the JSON result.
- .generate_apple_script(params) ⇒ Object
Class Method Details
.call(params) ⇒ Object
Run the generated AppleScript against OmniFocus and parse the JSON result.
59 60 61 62 63 |
# File 'lib/omnifocus_mcp/tools/generators/edit_item.rb', line 59 def call(params) require_relative "../operations/edit_item" Operations::EditItem.call(params) end |
.generate_apple_script(params) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/omnifocus_mcp/tools/generators/edit_item.rb', line 42 def generate_apple_script(params) params = Params::McpBoundary.coerce(Params::EditItemParams, params) return missing_identifier_error if Utils::Blank.blank?(params.id, params.name) id = Infrastructure::AppleScript.escape(params.id.to_s) name = Infrastructure::AppleScript.escape(params.name.to_s) item_type = params.item_type.to_s date_pre_scripts, date_assignments = collect_date_assignments(params) [ date_pre_scripts.join("\n\n"), Infrastructure::AppleScript.tell_document(document_body(item_type, id, name, params, date_assignments)) ].reject(&:empty?).join("\n\n") end |