Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6986129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:46:09+00:00 2026-05-27T18:46:09+00:00

Can’t pick a track from a playlist based on it’s file system path (location).

  • 0

Can’t pick a track from a playlist based on it’s file system path (location). See below.

I put arrows before the result of each command.

In the first line, I successfully find the first track from the playlist “Testing” with genre “R&B”.

Why doesn’t the fourth line work ? It looks like I am doing the same as line 1 only searching by file-system location instead of by genre.

Is there another way to do this ?

tell application "iTunes"....
  set t to first track of playlist "Testing" whose genre is "R&B"
   --> file track id 18476 of user playlist id 18414 of source id 72 of application "iTunes"

  set l to location of track 1 of playlist "Testing"
   --> alias "Lion:Users:cworth:Desktop:a.mp3"

  set f to POSIX file "/Users/cworth/Desktop/a.mp3" as alias
   --> alias "Lion:Users:cworth:Desktop:a.mp3"

  set tt to first track of playlist "Testing" whose location is f
   --> error "iTunes got an error: A descriptor type mismatch occurred." number -10001 to item
...end tell
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:46:10+00:00Added an answer on May 27, 2026 at 6:46 pm

    Studied up on Applescript and got it working with an explicit loop over the tracks: (see below)

    A possible explanation for why the example above doesn’t work is that the ‘first track of playlist “Testing” whose location is…’ returns a list of object specifiers (e.g. location of first track of playlist “Testing”, etc.) instead of a list of actual locations – i.e. what’s missing is the “get” command that returns the actual locations that you see inside the repeat loop below. That would explain the descriptor type mismatch, maybe ? I don’t have the Applescript expertise or motivation to go any further, now that I’ve got it working, but I’m glad that it is!

    tell application "iTunes"
    set f to POSIX file "/Users/cworth/Music/04 It's A Man's, Man's, Man's World.mp3"
    set a to f as alias
    set z to missing value
    repeat with tr in tracks of playlist "Testing"
        set ll to get location of tr
        if ll is a then set z to ll
    end repeat
    end tell
    log z
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how can I replace this 2 symbol below from the string
Can anyone recommend a good library for generating an audio file, such as mp3,
Can I call a java class method from inside a flash movie?
Can anyone tell me how to open Auto CAD file in HTML5? Is this
Can we put functions to determine the condition for our list comprehensions. Here is
Can I convert a pdf to pcl file with ghostscript? I'm using Ghostscript 9.01
Can someone tell me the regex to see if something is surrounded in double
Can somebody point me to a resource that explains how to go about having
Can anyone (maybe an XSL-fan?) help me find any advantages with handling presentation of
Can you cast a List<int> to List<string> somehow? I know I could loop through

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.