Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

162
Views
Javascript macOS Error: Named parameters must be passed as an object

I'm trying to implement automation for the task manager Things 3 on macOS using JXA (Javascript for macOS automation) and I'm running it to a strange error. I have spent countless hours trying to fix this myself and with the help of others. I am trying to use the following method described in the documentation:

schedule_method

As following:

// Set TaskApp as the app to use
var TaskApp = Application('Things3');

// Get the ToDo from toDos
var task = TaskApp.toDos["test555342343"]

// Get today as a date
var today = new Date()

// Schedule the task for Today
task.schedule(task.id(), {for: today})

This returns the error: Error: Error: Named parameters must be passed as an object.

When using another method (like show) the specefier works as expected:

enter image description here

Example:

// Set TaskApp as the app to use
var TaskApp = Application('Things3');

// Get the ToDo from toDos
var task = TaskApp.toDos["test555342343"]

// Bring Things3 to the Forground
TaskApp.activate()

// Show the task
task.show(task.id())

Will show the selected todo. Creating a task with with a deadline set to the date object also produces the correct result (a task with the deadline of date).

This documentation can only be found when you have things3 installed on macOS and you reference the Script Library. I have added the documentation as PDF. The described error also apply's to the move method. Instead of parsing a date you parse a List Object to it which will resolve in the same error.

Link to documentation PDF → Link

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The Things documentation is wrong: schedule is a method of Application, not of ToDo, which is why it asks for a todo specifier (it wouldn’t need that one if it was a property of a ToDo object already). The working code hence is:

// Set TaskApp as the app to use
var TaskApp = Application('Things3')

// Get the ToDo from toDos
var task = TaskApp.toDos["test555342343"]

// Get today as a date
var today = new Date()

// Schedule the task for Today
TaskApp.schedule(task, {for: today})

Note that task already is a ToDo specifier; you don’t need the detour through task.id(), which converts the ToDo specifier into an ID String before letting the schedule method cast that back to a specifier.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!