• 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: iTunes weirdness..
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iTunes weirdness..


  • Subject: Re: iTunes weirdness..
  • From: Matt Deatherage <email@hidden>
  • Date: Tue, 30 Aug 2005 01:40:03 -0500

On 8/30/05 at 12:53 AM, Jim Witte <email@hidden> wrote:

> but if I put
>
> tell application "iTunes"
>      get  file track id of current track
> end tell
>
> I get an error (Expected expression but found 'of')
>
> [...] Why can't I get the 'file track id' from the 'current track'
> descriptor?

Because "current track" does not have a "file track id" property.  You
are mistaking the reference to the current track with a list of
properties.  You also can't "get user playlist id of current track" for
the same reason.

It's the same concept that if Finder returns a reference like:

> document file "redline.mp3" of folder "Redline" of folder "Desktop" of
> folder "mattd" of folder "Users" of startup disk of application
> "Finder"

then you can't try

> get folder "Redline" of [that reference]

That long thing is a reference, not a container of parent folders.  Same with iTunes's answer - it's the ID of the current track, not a list of properties you can query.  You need to look at the actual properties in Script Debugger or something similarly powerful.

As it turns out, iTunes's "current track" object has a "container" object that has a "file tracks" object that includes every track in the current source.  These are in the same order they'd appear in the iTunes window, so if you're currently playing the 3rd item in a playlist, the item you want would be:

> file track 3 of container of current track

How to find which item you want (the "3" in this case) is on you.

Though, honestly, "current track" and "file track" are both subsets of "track," so it's easier just to ask for what you want.  Like, if you want the file track property "location" so you can see where the file is on disk, just ask for it:

> tell application "iTunes"
>   get location of current track
> end tell

...works for me.  "location" seems to be the only property of "file track" that's *not* inherited from "track", but it works for me anyway.

--
Matt Deatherage                              <email@hidden>
GCSF, Incorporated                      <http://www.macjournals.com>

"If it comes in a spray can, don't eat it."   --Ted Allen, Queer Eye

Now Playing "Star Spangled Banner" by The Pride Of Oklahoma, from "Rah-Rah! (2004)"
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >iTunes weirdness.. (From: Jim Witte <email@hidden>)

  • Prev by Date: Re: iTunes weirdness..
  • Next by Date: Re: iTunes weirdness..
  • Previous by thread: Re: iTunes weirdness..
  • Next by thread: Re: iTunes weirdness..
  • Index(es):
    • Date
    • Thread