• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to determine if iTunes has been updated or a sync has occurred?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to determine if iTunes has been updated or a sync has occurred?


  • Subject: Re: How to determine if iTunes has been updated or a sync has occurred?
  • From: Luther Fuller <email@hidden>
  • Date: Sun, 25 Mar 2012 13:33:34 -0500

On Mar 25, 2012, at 12:13 PM, Luther Fuller wrote:

I think the info you need is in the 'Tracks' dictionary/record. You can read this into AppleScript using "System Events", but you have to use the Xml Suite, not the not the Property List Suite. Somewhere I have the code to read 'Tracks' into a record, but I don't remember where it is at the moment.

I was curious about this, so I tried something. You can read an .xml file as if it were a .plist file, but ...
'Tracks' has a record of records structure which, at first seemed impossible get at.
I finally got a small test script to work. Here it is ...

property trackFile : alias "OS_X:Users:lutherfuller:Music:iTunes:iTunes Music Library.xml"

tell application "System Events"
value of property list item "Tracks" of property list file (trackFile as text)
set itemCount to (count records of the result)


set trackList to {}
set itemIndex to 0
repeat -- 100 times -- be careful !
set itemIndex to (1 + itemIndex) as text
try
set trackItem to value of property list item itemIndex of property list item "Tracks" of property list file (trackFile as text)
set trackList to (trackList & {trackItem})
log ((|track id| of trackItem) as text)
end try
if (count items of trackList) ≥ itemCount then exit repeat
end repeat
end tell
beep
delay 1

Have fun digging out the info you need!

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >How to determine if iTunes has been updated or a sync has occurred? (From: Michael Crawford <email@hidden>)
 >Re: How to determine if iTunes has been updated or a sync has occurred? (From: Michael Crawford <email@hidden>)
 >Re: How to determine if iTunes has been updated or a sync has occurred? (From: Luther Fuller <email@hidden>)

  • Prev by Date: Sending an image as attachment in Mail.
  • Next by Date: Re: Sending an image as attachment in Mail.
  • Previous by thread: Re: How to determine if iTunes has been updated or a sync has occurred?
  • Next by thread: Re: How to determine if iTunes has been updated or a sync has occurred?
  • Index(es):
    • Date
    • Thread