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

  • Home
  • SEARCH
  • 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 662807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:25:08+00:00 2026-05-13T23:25:08+00:00

The following code should show a certain track in iTunes: NSString* iTunesPath = [[NSWorkspace

  • 0

The following code should show a certain track in iTunes:

NSString* iTunesPath = [[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier:@"com.apple.iTunes"];

iTunesApplication *iTunes = nil;
if ( iTunesPath ) {
 iTunes = [[SBApplication alloc] initWithURL:[NSURL fileURLWithPath:iTunesPath]];
 [iTunes setDelegate:self];
}

iTunesSource *librarySource = nil;
NSArray *sources = [iTunes sources];
for (iTunesSource *source in sources) {
 if ([source kind] == iTunesESrcLibrary) {
  librarySource = source;
  break;
 }
}
SBElementArray *libraryPlaylist = [librarySource libraryPlaylists];
iTunesLibraryPlaylist *iTLibPlaylist = nil;
if ([libraryPlaylist count] > 0) {
 iTLibPlaylist = [libraryPlaylist objectAtIndex:0];
}


SBElementArray *fileTracks = [iTLibPlaylist fileTracks];

iTunesFileTrack *track = [fileTracks objectAtIndex:4];
NSLog(@"Try to reveal track: %@ at path :%@",[track description],[[track location] path]);
[track reveal];

Output:

Try to reveal track: <ITunesFileTrack @0x1364ed20: ITunesFileTrack 4 of ITunesLibraryPlaylist 0 of ITunesSource 0 of application "iTunes" (2474)> at path :/Users/...

But absolutely noting happens. What am I doing wrong?
(iTunes Version: 9.0.3)

  • 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-13T23:25:09+00:00Added an answer on May 13, 2026 at 11:25 pm

    The Library playlist doesn’t exist anymore in the UI; it’s there in the model, so it shows up in AppleScript, but trying to reveal it or anything in it won’t do anything in the UI, as you saw. You can reproduce this in AppleScript as well (reveal track 5 of library playlist 1 of source 1).

    The solution is to talk to the Music playlist, not the Library playlist. “Music” is the second playlist—playlist 2 in AppleScript, [[librarySource playlists] objectAtIndex:1] in Cocoa.

    If you want to reveal a playing item in whatever playlist it’s playing in, use reveal current track (which should be [[iTunes currentTrack] reveal], although I haven’t tested that).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that the following code should show and hide a tiny circular progress
The following code should allow to hide/show the CKEditor form <a onClick=$('#form1').hide();>Hide</a> <a onClick=$('#form1').show();>Show</a>
I have the following code that should show the value for the display field
The following code should show either the port or server name not both. I
I'm using the following code to show a box when you mouseover a certain
I have the following code, which, upon the press of a certain button, should
The following code should find the appropriate project tag and remove it from the
In this thread some one commented that the following code should only be used
How to print multiply flowdocumets in a batch? Following code should print different documents
I have the following code which should put programs startable in Bash. if [

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.