• 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: Adding files to iTune library in Cocoa app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding files to iTune library in Cocoa app


  • Subject: Re: Adding files to iTune library in Cocoa app
  • From: John Stiles <email@hidden>
  • Date: Mon, 25 Jun 2007 14:52:53 -0700

On Jun 25, 2007, at 12:26 PM, Gregory Weston wrote:

Angelo Chen wrote:

Is there a way to add files into iTune library in a
Cocoa app? Thanks

tell application "iTunes" to add (POSIX file "thePath") to (first library playlist)


Wrap that in an NSAppleScript, with thePath replaced by the full path of the track you want to add.

Be careful—this will not work if the path contains any non-MacRoman characters. (Which means that in many countries it will never work.)
The fix involves replacing "thePath" with a goofy hack/workaround that looks like this:


(«data utf84142434445464748» as Unicode text)

You plug in hexadecimal numbers corresponding to the path string, in UTF8, after the 'utf8' bit.
I wish there were a simpler way…_______________________________________________


Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Adding files to iTune library in Cocoa app
      • From: Gregory Weston <email@hidden>
References: 
 >Re: Adding files to iTune library in Cocoa app (From: Gregory Weston <email@hidden>)

  • Prev by Date: Re: Finder window - coordinates and screen?
  • Next by Date: Re: Super-sized NSDrawer
  • Previous by thread: Re: Adding files to iTune library in Cocoa app
  • Next by thread: Re: Adding files to iTune library in Cocoa app
  • Index(es):
    • Date
    • Thread