Hello all, I’m trying to do something that will read plist items in order and utilize them, but when I loop through them and get their values, they seem to be mismatched. Here is the plist:
<?xml version="1.0" encoding="UTF-8"?> Test1 Test1 Test2 Test2 Test3 Test3 Test4 Test4 Test5 Test5And here is the code I’m using to loop through the items:
tell application "System Events"
tell property list file thePath
repeat with i from 1 to (count property list items)
log "i: " & i & ", value: " & value of property list item i & ""
end repeat
end tell
end tell
And this is what it returns:
tell application "System Events"
count every property list item of property list file "~/Desktop/ATIS_Data.plist"
--> 5
get value of property list item 1 of property list file "~/Desktop/ATIS_Data.plist"
--> "Test1"
(*i: 1, value: Test1*)
get value of property list item 2 of property list file "~/Desktop/ATIS_Data.plist"
--> "Test3"
(*i: 2, value: Test3*)
get value of property list item 3 of property list file "~/Desktop/ATIS_Data.plist"
--> "Test5"
(*i: 3, value: Test5*)
get value of property list item 4 of property list file "~/Desktop/ATIS_Data.plist"
--> "Test2"
(*i: 4, value: Test2*)
get value of property list item 5 of property list file "~/Desktop/ATIS_Data.plist"
--> "Test4"
(*i: 5, value: Test4*)
end tell