I am trying to retrieve values from a .plist to transfer to a .csv
The values will be different with each use, the script I have is
set f to (path to desktop as text) & "results.plist"
tell application "System Events"
tell (value of (contents of property list file f)) as list
set |track name| to {}
end tell
end tell
return |track name|
the .plist is
<?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">
<array>
<dict>
<key>Track Name</key>
<string>Track 1</string>
<key>time</key>
<string>00:01:30;00</string>
</dict>
<dict>
<key>Track Name</key>
<string>Track 2</string>
<key>time</key>
<string>00:01:30;00</string>
</dict>
<dict>
<key>Track Name</key>
<string>Track 3</string>
<key>time</key>
<string>00:01:30;00</string>
</dict>
<dict>
<key>Track Name</key>
<string>Track 4</string>
<key>time</key>
<string>00:01:30;00</string>
</dict>
<dict>
<key>Track Name</key>
<string>Track 5</string>
<key>time</key>
<string>00:01:30;00</string>
</dict>
<dict>
<key>Track Name</key>
<string>Track 6</string>
<key>time</key>
<string>00:01:30;00</string>
</dict>
<dict>
<key>Track Name</key>
<string>Track 7</string>
<key>time</key>
<string>00:02:00;00</string>
</dict>
</array>
</plist>
If i look at the events when I run it I can see all the values I need but it keeps returning a blank!
I am new to applescript so I know it is probably an easy fix but I have been searching for hours now and keep coming up with a blank, If i try
tell (value of (contents of property list file f)) as record
it returns an error as not being able to make in to type record but it has the info i need!!
any help would be greatly appreciated
Thanks
Ben