File Monitors
Octory can monitor a file at a specified path, which will generate a variable you can use in a condition or see in the logs.
The application will automatically generate a variable based on the file name: IS_[FILENAME]_[EXTENSION]_FILE_PRESENT with a true or false value.
The check of the file presence happens every 5 seconds.
Keys
| Name | Type | Possible values | Required |
|---|---|---|---|
| [Type] (#type) | String | File | Required |
| [Path] (#path) | String | - | Required |
| DisplayName | String | - | Required |
| Detail | String | - | |
| IconURL | String | - | |
| IsMandatory | Boolean | - | |
| IsHidden | Boolean | - | |
| Condition PRO | String | - |
Detail
Type Required
Type: String
Possible values: File
Explanation: Monitor type has to be File.
Path Required
Type: String
Explanation: The path to the file whose presence you want to monitor.
DisplayName Required
Type: String
Explanation: The name which will be displayed to the user in the MonitorsDisplay component.
Detail
Type: String
Explanation: Description text displayed under the display name in the MonitorsDisplay component.
IconURL
Type: String
Explanation: Let you specify a local or online URL for the icon to be shown in the MonitorsDisplay component. Octory will use a generic icon image if not specified.
IsMandatory
Type: String
Default: false
Explanation: If true, the application will prevent the user to quit if the file is not present.
IsHidden
Type: Boolean
Default: false
Explanation: If true, the monitor will not be displayed in the MonitorsDisplay compoenent. A hidden monitor can still be mandatory, this is more a UI option.
Condition PRO
Type: String
Explanation: Conditions to decide if the monitor should be shown in MonitorsDisplay component. When the condition evolves, an animation occurs in the MonitorsDisplay component to insert or remove the monitor. More information on conditions.
Example
Monitor the presence of the file termination.sh in the folder /Library/Application Support/Octory/Scripts/. The generated variable will be IS_TERMINATION_SH_FILE_PRESENT.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- ... -->
<key>Monitoring</key>
<dict>
<key>Monitors</key>
<array>
<dict>
<key>Type</key>
<string>File</string>
<key>Path</key>
<string>/Library/Application Support/Octory/Scripts/termination.sh</string>
</dict>
</array>
</dict>
<!-- ... -->
</dict>
</plist>
Monitor the presence of the file myFile.txt in the user home folder. The generated variable will be IS_MYFILE_TXT_FILE_PRESENT. Note the usage of a placeholder to get the current logged in user name.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- ... -->
<key>Monitoring</key>
<dict>
<key>Monitors</key>
<array>
<dict>
<key>Type</key>
<string>File</string>
<key>Path</key>
<string>/Users/${USER_NAME}/myFile.txt</string>
</dict>
</array>
</dict>
<!-- ... -->
</dict>
</plist>