ReferenceControlArcReferenceStandard Libraryranges

ranges

Arc standard library reference for the ranges module: create and end

The ranges module creates and closes ranges on the Core, letting a program mark regions of time as an automation runs.

create

Creates a range that starts now and stays open. Its end is set to the maximum timestamp, shown as “In progress”. Outputs the new range key.

ranges.create{name: str, parent?: str, color?: str} -> str

Parameters

  • name: A human-readable name for the range.
  • parent: The key of an existing range to nest under. No parent if omitted.
  • color: A display color: hex (#3bc454), rgb(r, g, b), or rgba(r, g, b, a).

Output

The new range key.

sequence ranges_create {
    ranges.create{name="Terminal Count", color="#3bc454"} -> range_key
}

end

Sets the end bound of an existing range to now, closing an open range, and outputs the range key.

ranges.end{key: str} -> str

Parameters

  • key: The key of the range to close.

Output

The range key that was closed.

sequence ranges_end {
  trigger -> ranges.end{key=range_key}
}