Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3403972
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:19:31+00:00 2026-05-18T05:19:31+00:00

I trying to output a list of todo items from the Mac app Things

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T05:19:32+00:00Added an answer on May 18, 2026 at 5:19 am

    Sure, this is readily doable. The problem is that outside the tell application "Things" ... end tell block, AppleScript doesn’t know what things would be special inside it, and doesn’t even both to look. All you need to do, then, is move the tell block within on getTodos(listName) ... end getTodos:

    on getTodos(listName)
      tell application "Things"
        repeat with todo in to dos of list "Inbox"
          set todoName to the name of todo
          set output to output & todoName
        end repeat
      end tell
    end getTodos
    

    You may also be able to replace tell with using terms from; I think that should work. Also, you never use listName—did you mean to replace "Inbox" with listName?

    You should, however, be able to replace getTodos with the single line

    on getTodos(listName)
      tell application "Things" to get the name of the to dos of list listName
    end getTodos
    

    This sort of shortcut is one of the things AppleScript is good at. Also, note that this new version doesn’t modify output, but just returns the list; I’d argue that’s a better decision anyway, but you can always do set output to output & ....

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can we get list of output cached URLs in IIS7? I am trying to
I am trying to customize the output of the comments list and forms using
I am trying to output some Java objects as JSON, they have List properties
I am trying to output dates in the Italian format using date() as follows:
I am using an ASP repeater control to output a list to the visitor.
What I'm trying to do is ask the user for a list of items,
I am trying to add a map to a Windows 8 Store app using
Using Python, I'm trying to read a list or strings backwards. When finding the
I am trying to parse review from this page: http://www.amazon.co.uk/product-reviews/B00143ZBHY Using following approach: Code
Here's what I'm trying to do. I have an extremely large list of items.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.