Skip to main content

How to read Octory inputs file

When you ask information to the end user with an InputComponent, Octory will store the inputs in a file.
This file has a default name of Octory_inputs and will be stored at ~/Octory/Octory_inputs.json with a JSON default data format.
You can change this behavior by editing the Input section in the configuration file. To change the data format to Plist for example.

The thing is, what should you do with this input file once Octory is terminated? You can send it to your MDM, or use it to locally make some additional configuration.
In any case, you might need to read the information it contains. Here are some solutions with the following example JSON or its Plist equivalent.


"AssetTag": "GT6J8IO",
"UserRole": "Consultant",
"Supplies": [true, false, true]


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">

Read the Asset tag

Python script (Plist)

import plistlib
plistname = "/path/to/Octory_inputs.plist"
pl = plistlib.readPlist(plistname)

if pl["AssetTag"] != 0:
tag = pl["AssetTag"]
print "Not Indicated"

Bash script with defaults (Plist)

if [ -f "/path/to/Octory_inputs.plist" ] ; then
TAG=$( defaults read "/path/to/Octory_inputs.plist" AssetTag )
TAG="Not Indicated."

echo "$TAG"

Read the "Supplies" second value

Python script (Plist)

import plistlib
plistname = "Octory_inputs.plist"
pl = plistlib.readPlist(plistname)

if pl["Supplies"] != 0:
supplies = pl["Supplies"]
if len(supplies) > 1:
secondSupply = supplies[1]
print "Not Indicated"

You can then send this value to your MDM with a curl command, or use it in another script.

Discover more

  • You can checkout the Form preset to see how information can be asked to the user and how to save those inputs in a specific format and at a specific path.
  • See the the API requests PRO feature in action.