User Tools

Site Tools


xtdb:applescript:adddatapoint

Table of Contents

Add Datapoint

The Add Datapoint verb can be used to manually add data to any Units database. If the Unit is not already in the Database it will be created. This allows you to create databases that do not have a corresponding Unit in XTension.

Usage:

  • AddDatapoint [String: Unit Name to add the value to or List (see below)]
    • value [optional, real number, the value to add]

Instead of the Unit Name you can pass an applescript list with name/value pairs in it to add several values to different databases, See the example below.

The Unit does not need to be a Unit actually in XTension. You can use this method to create databases for values or items that are not part of the XTension database.

Note that you cannot specify the date of the value when using this verb. Any data added via this verb will be added with the current date.

Examples:

tell app “XTdb” to AddDatapoint “my temperature sensor” value 97.6

Use an AppleScript list to add datapoints to several databases at once. Leave out the value when using a list.

tell app “XTdb”
  AddDatapoint {“sensor 1”, 75,2 “sensor 2”, 34.6, “fridge temp”, 38.4}
end tell
xtdb/applescript/adddatapoint.txt · Last modified: 2023/02/13 14:52 by 127.0.0.1