Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

159
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda