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/"

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.
    • [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.
    • Result: project -- The newly-created project.
  • update project -- Updates an existing project's properties.
    • project
    • [name text] -- The new name of the project.
    • [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.
    • Result: project -- The updated 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 task -- Starts tracking time for a new task.
    • [with title text] -- The title of the new task.
    • [project project] -- The name of the project to assign the task's time to.
    • [notes text] -- The notes of the new task.
    • [for about real] -- The number of seconds after which Timing should ask you whether you want to keep tracking.
  • stop current task -- Stops tracking time for the currently running task.
    • [notification boolean] -- Whether to display a notification that the current task was stopped.
    • Result: boolean -- True if a task was active that could be stopped.
  • add task -- Starts tracking time for a new task.
    • from date -- The start date of the new task.
    • to date -- The end date of the new task.
    • [with title text] -- The title of the new task.
    • [project project] -- The name of the project to assign the task's time to.
    • [notes text] -- The notes of the new task.
  • save report -- Generates a 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.

Classes

  • application -- The TimingHelper 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.
    • Elements:
      • project -- by name, index, relative, range, test, id
  • project -- A project that tasks 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.
      • 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.
      • 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.
      • 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 tasks (r/o) real -- The total time recorded over the given period, excluding tasks (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 tasks (r/o) record -- A record with the names of projects as keys and the corresponding recorded times (excluding tasks), 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 project / raw -- The first criterion to group data by.
      • second grouping mode by year / by month / by week / by day / by project / raw -- The second criterion to group data by.
      • tasks included boolean -- Whether to include tasks. in the report
      • task title included boolean -- When tasks are included, whether to also provide the task's title.
      • also group by task title boolean -- When including tasks and task titles, whether to also group by task title.
      • task timespan included boolean -- When tasks are included, whether to also provide the task's timespan.
      • task notes included boolean -- When tasks are included, whether to also provide the task'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.
      • also group by application boolean -- When including app usage and application info, whether to also group by application.
      • include app activities covered by a task boolean -- When including both app usage and tasks in a report, whether to include app usage that is already contained in a task.
  • 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.