Full AppleScript Reference for Timing

The documentation's "Integrations" section contains many practical examples of using Timing's AppleScript capabilities.

Note that scripts addressing Timing should begin with tell application "TimingHelper", not with tell application "Timing".

You can also view Timing's AppleScript documentation by running the following command in a Terminal window:

open -a "Script Editor" "/Applications/Timing.app/Contents/Library/LoginItems/TimingHelper.app/"

Table of Contents

Feature Availability

Our "Expert" plan includes access to basic scripting support. For example, the following workflows are possible with a Timing Expert subscription:

  • Starting and stopping timers (start timer, stop current timer)
  • Adding time entries (add time entry)
  • Pausing and resuming tracking (pause tracking, resume tracking)
  • Generating a summary of the time spent in a particular date range (get time summary)
  • Listing all projects and retrieving their properties (get projects of application)

However, the following commands require a Timing Connect subscription:

  • Manipulating projects (create project, update project, delete project)
  • Generating detailed reports (save report, make report settings, make export settings)

AppleScript Reference

Commands

  • create project -- Creates a new project.
    • name text -- The name of the new project.
    • [parent project project] -- The parent project of the new project.
    • [team name text] -- The name of the team that the project should be created on.
    • [color text] -- The color associated with the new project, in the form #RRGGBBAA.
    • [productivity rating real] -- The productivity rating of the new project, between 0 and 1.
    • [rule data text] -- A string representing the new project's rules. Note that this data's format is not documented and should be treated as opaque. If you want to create projects with custom rules, please request assistance from support.
    • Result: project -- The newly-created project.
  • update project -- Updates an existing project's properties.
    • project
    • [name text] -- The new name of the project.
    • [is archived boolean] -- Whether the project is archived.
    • [color text] -- The new color associated with the project, in the form #RRGGBBAA.
    • [productivity rating real] -- The new productivity rating of the project, between 0 and 1.
    • [rule data text] -- A string representing the project's new rules. Note that this data's format is not documented and should be treated as opaque. If you want to create projects with custom rules, please request assistance from support.
    • Result: project -- The updated project.
  • delete project -- Deletes an existing project and all of its children.
    • project
    • Result: text -- A string confirming deletion of the project.
  • pause tracking -- Pauses tracking for the given time period.
    • [for real] -- The time to pause tracking for, in seconds. Omit to pause indefinitely.
  • resume tracking -- Resumes tracking.
  • get time summary -- Returns usage statistics for the specified date range.
    • between date -- The start date for which to return a summary.
    • and date -- The end date for which to return a summary.
    • Result: time summary -- Usage statistics for the specified date range.
  • start timer -- Starts tracking time for a new time entry.
    • [with title text] -- The title of the new entry.
    • [project project] -- The name of the project to assign the entry's time to.
    • [notes text] -- The notes of the new entry.
    • [for about real] -- The number of seconds after which Timing should ask you whether you want to keep tracking.
  • stop current timer -- Stops tracking time for the currently running timer.
    • [notification boolean] -- Whether to display a notification that the current timer was stopped.
    • Result: boolean -- True if a timer was active that could be stopped.
  • add time entry -- Creates a new time entry.
    • from date -- The start date of the new entry.
    • to date -- The end date of the time entry.
    • [with title text] -- The title of the new entry.
    • [project project] -- The name of the project to assign the entry's time to.
    • [notes text] -- The notes of the new entry.
    • [replace existing time entries boolean] -- Whether to remove time entries that might already exist in the specified date range.
  • save report -- Generates an advanced report and saves it.
    • with report settings report settings -- The report settings, e.g. how to group and what data to include.
    • export settings export settings -- The export settings, e.g. what file format to save.
    • to file
    • between date -- The start date for the report.
    • and date -- The end date for the report.
    • [for projects list of project] -- The projects to include in the report.
    • [with subprojects included boolean] -- Whether to include all child projects of the provided projects.

Classes

  • application -- The Timing tracker application.
    • Plural name:
      • applications
    • Properties:
      • root projects (r/o) list of project -- The application's top level projects.
      • scripting support available (r/o) boolean -- Indicates whether your license includes support for automating Timing via AppleScript.
      • advanced scripting support available (r/o) boolean -- Indicates whether your license includes support for advanced automation (e.g. generating reports).
    • Elements:
      • project -- by name, index, relative, range, test, id
  • project -- A project that time entries and app activities can be associated with.
    • Plural name:
      • projects
    • Properties:
      • id (r/o) text -- The unique identifier of the object.
      • name (r/o) text -- The name of the object.
      • team name (r/o) text -- The name of the team that this project belongs to.
      • color (r/o) text -- The color associated with the project, in the form #RRGGBBAA.
      • productivity rating (r/o) real -- The productivity rating of the project, between 0 and 1.
      • is archived (r/o) boolean -- Indicates whether the project has been archived.
      • rule data (r/o) text -- A string representing the project's rules. Note that this data's format is not documented and should be treated as opaque. If you want to create projects with custom rules, please request assistance from support.
      • name chain (r/o) text -- The name of the object and all its parents, in the form 'Parent ▸ Child ▸ Grandchild'.
      • parent project (r/o) project -- The project's parent project.
      • container (r/o) project -- The project's parent project. Same as 'parent project'.
    • Elements:
      • project -- by name, index, relative, range, test, id
  • time summary -- A container for various usage statistics.
    • Plural name:
      • time summarys
    • Properties:
      • id (r/o) text -- The unique identifier of the object.
      • productivity score (r/o) real -- The overall productivity score over the given period, between 0 (very unproductive) and 1 (very productive).
      • overall total (r/o) real -- The total time recorded over the given period, in seconds.
      • overall total without time entries (r/o) real -- The total time recorded over the given period, excluding time entries (i.e. app usage only), in seconds.
      • times per project (r/o) record -- A record with the names of projects as keys and the corresponding recorded times, in seconds.
      • times per project without time entries (r/o) record -- A record with the names of projects as keys and the corresponding recorded times (excluding time entries), in seconds.
  • report settings -- Holds settings to modify how a report is generated.
    • Plural name:
      • report settingss
    • Properties:
      • id (r/o) text -- The unique identifier of the object.
      • first grouping mode by year / by month / by week / by day / by hour / by project / by parent project / by toplevel project / by secondlevel project / raw / none -- The first criterion to group data by.
      • second grouping mode by year / by month / by week / by day / by hour / by project / by parent project / by toplevel project / by secondlevel project / raw / none -- The second criterion to group data by.
      • time entries included boolean -- Whether to include time entries in the report
      • time entry title included boolean -- When time enties are included, whether to also provide the time entry's title.
      • also group by time entry title boolean -- When including time entries and their titles, whether to also group by time entry title.
      • time entry timespan included boolean -- When time entries are included, whether to also provide the time entry's timespan.
      • time entry notes included boolean -- When time entries are included, whether to also provide the time entry's notes.
      • app usage included boolean -- Whether to include app usage data in the report.
      • application info included boolean -- When app usage is included, whether to also provide the application's name.
      • title info included boolean -- When app usage is included, whether to also provide the activity's title.
      • path info included boolean -- When app usage is included, whether to also provide the activity's path
      • timespan info included boolean -- When app usage is included, whether to also provide the activity's time span.
      • device info included boolean -- When app usage is included, whether to also provide the activity's device.
      • also group by application boolean -- When including app usage and application info, whether to also group by application.
      • include app activities covered by a time entry boolean -- When including both app usage and time entries in a report, whether to include app usage that is already contained in a time entry.
  • export settings -- Holds settings to modify how a report is saved to disk.
    • Plural name:
      • export settingss
    • Properties:
      • id (r/o) text -- The unique identifier of the object.
      • file format Excel / CSV / HTML / JSON -- The file format to export.
      • duration format hhmmss / xhymzs / seconds / hours -- How to format durations in the export.
      • short entries included boolean -- Whether to include entries below the threshold provided in the main app's settings.

Take our free 5-day course to get started with Timing.