Enhanced ProperTree's plist analysis to handle UID references more intelligently:
- When a UID refers to a single value, it displays the value in parentheses next to the UID
- When a UID refers to a collection (dictionary/array), it displays as a clickable hyperlink that jumps to the referenced node
Scripts/plistwindow.py: Added three new methods for UID reference handling
- Locates a tree node by its UID index reference
- Correctly maps UID indices to elements in the
$objectsarray - Returns the corresponding tree node or None if not found
- Formats UID display text based on the referenced content
- For single values: shows "UID X (value)"
- For collections: shows "UID X → (N items)"
- Handles edge cases like invalid indices gracefully
- Navigates to the node referenced by a UID
- Selects, focuses, and scrolls to the target node
- Returns True if successful, False otherwise
_add_node: Now usesget_uid_reference_displayfor UID and CF$UID valueson_double_click: Enhanced to handle UID value clicks and trigger navigation
Apple's plist format with UIDs contains:
$objectsarray: Contains all the actual data objects- UID references: Point to indices in the
$objectsarray CF$UIDdictionaries: Contain the UID index values
- When displaying a UID value, the code looks up the
$objectsarray - Finds the element at the specified UID index
- Determines if it's a single value or collection
- Formats the display accordingly
- When double-clicked, navigates to the referenced node in the tree
test_uid.plist: Basic UID reference testtest_uid_comprehensive.plist: Comprehensive test with various data typestest_uid_edge_cases.plist: Edge cases (invalid, negative, out-of-bounds UIDs)
- Single values (strings, numbers, booleans): Display as "UID X (value)"
- Collections (dictionaries, arrays): Display as "UID X → (N items)" and are clickable
- Invalid UIDs: Display as "UID X (invalid)"
- Double-clicking on UID values should jump to the referenced node
-
Open ProperTree with any of the test files:
python ProperTree.py test_uid_comprehensive.plist -
Look for UID references in the tree view:
- Single values should show the actual value in parentheses
- Collections should show item count and be clickable
-
Double-click on UID values to test navigation:
- Should jump to the corresponding node in the
$objectsarray - The target node should be selected and visible
- Should jump to the corresponding node in the
- Gracefully handles invalid UID indices
- Handles missing
$objectsarrays - Handles malformed UID data
- Falls back to displaying raw UID values when errors occur
- Maintains backward compatibility with existing ProperTree functionality
- Only affects display and interaction with UID values
- Does not modify the underlying plist data structure