I trying to output a list of todo items from the Mac app Things using AppleScript.
But I get a syntax error: Expected expression but found “to”.
Since Things uses the name "to dos" and AppleScript doesn't like this, since to is a reserved keyword. It works without a problem if the repeat code is directly inside the tell statement and not in the function handler.
Is there any way around this?
set output to ""
on getTodos(listName)
repeat with todo in to dos of list listName
set todoName to the name of todo
set output to output & todoName
end repeat
end getTodos
tell application "Things"
getTodos("Inbox")
getTodos("Today")
end tell
Is this even possible to do it like this?
And is there a better way to do this?