Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

166
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda