Skip to content

Inspect Mode

The SwiftDialog Inspect Mode is a new built-in feature that enables real-time monitoring within the macOS filesystem. It tracks filesystem status (utilizing Apple’s FSEvents API) while monitoring application installations and inspecting cache folders, files, and plist content to visualize compliance checks. This feature is specifically designed for use during device enrollment, software deployment, and compliance auditing, providing end users with clear visibility into their compliance status.

Inspect Mode continuously monitors the specified file paths and cache directories to track the status of applications or system components. It provides visual feedback through various preset layouts, each tailored for different use cases.

  • Real-time file system monitoring
  • Download progress detection via cache monitoring
  • Multiple visual presets for different scenarios
  • Plist-based simple validation (bool, string, and exists)
  • Customizable theming and branding (limited)
  • Auto-enabling buttons upon completion
  1. Create a JSON configuration file:
{
"title": "Application Installation",
"items": [
{
"id": "app1",
"displayName": "Microsoft Word",
"guiIndex": 0,
"paths": ["/Applications/Microsoft Word.app"]
}
]
}
  1. Launch swiftDialog with inspect flag:
Terminal window
/usr/local/bin/dialog --inspect-mode --inspect-config /path/to/config.json
  1. Optionally, set the config file path environment variable:
Terminal window
export DIALOG_INSPECT_CONFIG="/path/to/config.json"
/usr/local/bin/dialog --inspect-mode
KeyTypeRequiredDefaultDescription
presetStringNo”preset1”Visual layout preset (preset1-7)
titleStringNo”System Inspection”Window title
messageStringNo-Main message text
iconStringNo-Icon path or SF Symbol (e.g., “sf=shield.fill”)
sizeStringNo”standard”Window size: “compact”, “standard”, “large”
widthIntegerNo-Custom window width (overrides size)
heightIntegerNo-Custom window height (overrides size)
cachePathsArrayNo-Directories to monitor for downloads
scanIntervalIntegerNo2File system scan interval in seconds
button1textStringNo”OK”Primary button text
button1disabledBooleanNofalseDisable primary button initially
button2textStringNo”Cancel”Secondary button text
button2visibleBooleanNotrueShow secondary button
autoEnableButtonBooleanNotrueAuto-enable button when complete
autoEnableButtonTextStringNo”OK”Button text when auto-enabled
itemsArrayYes-Array of items to inspect
KeyTypeDefaultDescription
bannerString-Banner image path (overrides icon)
bannerHeightInteger100Banner height in pixels
bannerTitleString-Title overlay on banner
highlightColorString”#808080”Accent color (hex)
backgroundColorString-Background color (hex)
backgroundImageString-Background image path
backgroundOpacityDouble1.0Background opacity (0-1)
textOverlayColorString-Text overlay color for backgrounds
gradientColorsArray-Array of hex colors for gradient
iconBasePathString-Base path for relative icon paths
appearanceString”auto”Force the inspect window appearance: "dark", "light", or "auto" (follow the OS). Overrides the OS setting in both directions.

Each item in the items array requires:

KeyTypeRequiredDescription
idStringYesUnique identifier
displayNameStringYesDisplay name in UI
guiIndexIntegerYesSort order (0-based)
pathsArrayYesFile paths to check for existence
iconStringNoItem-specific icon
plistKeyStringNoPlist key to validate
expectedValueStringNoExpected plist value
evaluationStringNoEvaluation type: “equals”, “boolean”, “exists”, “contains”, “range”
descriptionStringNoOptional description shown below the item title (rendered by presets 1, 2, 3, 5 and 6)

Monitor download directories to detect in-progress installations:

{
"cachePaths": [
"/Library/Managed Installs/Cache",
"/Library/Application Support/Installomator/Downloads",
"/Library/Application Support/JAMF/Downloads",
"/Library/Application Support/AirWatch/Data/Munki/Managed Installs/Cache"
],
"scanInterval": 5,
"cacheExtensions": ["download", "pkg", "dmg", "aria2"]
}

By default, files ending in .pkg, .dmg, and .download within cachePaths mark a matching item as downloading. Set cacheExtensions to change that list — for example, add aria2 so aria2c’s <name>.aria2 partial files are detected (issue #617). The leading dot is optional.

Validate system configuration using plist checks:

{
"preset": "preset5",
"items": [{
"id": "findmymac",
"displayName": "Find My Mac Status",
"guiIndex": 0,
"paths": ["/Library/Preferences/com.apple.FindMyMac.plist"],
"plistKey": "FMMEnabled",
"expectedValue": "true",
"evaluation": "boolean"
}]
}

Define custom compliance levels and colors:

{
"colorThresholds": {
"excellent": 0.95,
"good": 0.80,
"warning": 0.60,
"excellentColor": "#00C853",
"goodColor": "#2196F3",
"warningColor": "#FF9800",
"criticalColor": "#F44336"
}
}

For plist-driven compliance reporting, add a top-level plistSources array. swiftDialog aggregates the referenced plists into categories with pass/total counts and an overall score, then renders them through the compliance-summary and findings-list content blocks (and any bento cells), refreshing on an interval.

{
"plistSources": [
{
"path": "/Library/Preferences/com.company.compliance.plist",
"type": "compliance",
"healthyLabel": "Compliant",
"attentionLabel": "Action Required"
}
],
"guidance": [
{ "type": "compliance-summary" },
{ "type": "findings-list" }
]
}

plistSources[] properties:

KeyTypeDefaultDescription
pathString-Path to the plist file
typeString-Source type: compliance, health, licenses, preferences, or custom
healthyLabelString”Healthy”Label for a passing check
(appears in summary cards, findings rows and bento subtitles)
attentionLabelString”Needs Attention”Label for a failing check
successValuesArray-Values that indicate success
expectedValueString-Expected value for compliance
findingKeyString”finding”Subkey to read the finding detail from
timestampKeyStringautoKey holding the last-check time (auto-tries lastComplianceCheck, LastUpdateCheck, lastCheck, timestamp)
includePatternString-Regex of keys to include in auto-discovery
excludeKeysArray-Keys to exclude from auto-discovery
keyMappingsArray-How to interpret specific plist keys
maxCheckDetailsInteger15Max check items shown per category
iconString-SF Symbol for the category

Content blocks that render the aggregated data:

  • compliance-summary — a banner with the overall status plus per-category stat cards.
  • findings-list — a category-grouped, disclosable list of individual checks.

Bento cells also auto-bind to the same data: a cell’s subtitle and icon colour
update from live findings, with no extra schema fields required.

{
"title": "Installing Office Suite",
"message": "Please wait while we install your applications",
"preset": "preset1",
"icon": "sf=apps.iphone.badge.plus",
"iconBasePath":"/Users/Shared/icons/",
"cachePaths": ["/Users/Shared/Downloads"],
"button1text": "Please Wait...",
"button1disabled": true,
"autoEnableButton": true,
"autoEnableButtonText": "Continue",
"items": [
{
"id": "microsoft_word",
"displayName": "Microsoft Word",
"guiIndex": 0,
"paths": ["/Applications/Microsoft Word.app"],
"icon": "Microsoft Word.png"
},
{
"id": "microsoft_excel",
"displayName": "Microsoft Excel",
"guiIndex": 1,
"paths": ["/Applications/Microsoft Excel.app"],
"icon": "Microsoft Excel.png"
},
{
"id": "microsoft_powerpoint",
"displayName": "Microsoft PowerPoint",
"guiIndex": 2,
"paths": ["/Applications/Microsoft PowerPoint.app"],
"icon": "Microsoft PowerPoint.png"
}
]
}
  • Verify JSON syntax using jq or online validators
  • Check file permissions (must be readable)
  • Ensure environment variable is properly exported
  • Verify exact file paths (case-sensitive)
  • Check if paths require admin privileges
  • Use cachePaths for download detection
  • Increase scanInterval for slower systems

Enable debug output:

Terminal window
/usr/local/bin/dialog --inspect-mode --debug
Terminal window
export DIALOG_DEBUG=1
/usr/local/bin/dialog --inspect-mode
  • DIALOG_INSPECT_CONFIG: Path to configuration JSON
  • DIALOG_DEBUG: Enable debug logging
  • DIALOG_COMMAND_FILE: Custom command file path
  1. Start Simple: Begin with preset1 and minimal configuration
  2. Test Paths: Verify all file paths exist or will exist
  3. Use Cache Monitoring: Add cachePaths for download detection
  4. Icon Management: Store icons in a central location with iconBasePath
  5. Button States: Use autoEnableButton for better UX
  6. Appropriate Presets: Choose presets based on use case:
    • Installation tracking: Preset 1 or 2 or 3
    • Compliance display: Preset 4