Customizing Hook integration with Things

  1. Home
  2. Docs
  3. Help & Support
  4. Integration
  5. Customizing Hook integration with Things

-- Get Address for Things
tell application id "com.culturedcode.ThingsMac"
    set n to count of selected to dos
    if n = 1 then
        set todo_id to id of item 1 of selected to dos
    else if n = 0 then
        try
            set todo_name to name of item 1 of windows
            set todo_id to id of to do todo_name
        end try
    else
        set proj to project of item 1 of selected to dos
        repeat with todo in selected to dos
            if proj is not project of todo then
                return
            end if
        end repeat
        set todo_id to id of proj
    end if
    set todo_url to "things://show?id=" & todo_id
    todo_url
end tell

The way Hook integrates with Things is complex. It has different behaviour in different cases

  • If one item (to do) is selected, Hook will link to that item.
  • If a project is open and no items are selected, or if the project header is selected, Hook will link with the project.
  • If multiple items are selected, and they all belong to the same project, Hook will link to that project.
  • If multiple items are selected, and they do not belong to the same project, Hook will not link to anything.

‘Only link to projects’ alternate Things integration

By editing integration scripts, such as for Things, users can customize the behaviour to match their personal workflows.

For example, a user might prefer to always link to the current list, (e.g. Inbox, Today, a project). They could do that by using these Get Address and Get Name scripts.

-- Get Name for Things
tell application id "com.culturedcode.ThingsMac"
    get name of item 1 of windows
end tell
-- Get Address for Things
tell application id "com.culturedcode.ThingsMac"
    set todo_id to name of item 1 of windows
    try
        set todo_id to id of to do todo_id
    end try
    get "things://show?id=" & todo_id
end tell
Was this article helpful to you? Yes No

How can we help?