On Jun 13, 2006, at 3:02 PM, Mel Patrick wrote:

Anyone have a snippet on how to use RB's AppleEvents to make a playlist in iTunes? I found some code in the archives, but the name for the playlist doesn't seem to be used (iTunes calls is "Unititled Playlist").

Here you go:


  Dim aeobjref as AppleEventObjectSpecifier
  Dim AERecordParam as AppleEventRecord

  Dim ae as AppleEvent

  ae=NewAppleEvent("core", "crel", "hook")

  ae.MacTypeParam("kocl")="cPly"

   aeobjref=GetNamedObjectDescriptor("cSrc", nil, "Library")
  ae.ObjectSpecifierParam("insh")=aeobjref
  AERecordParam=new AppleEventRecord
  aerecordParam.StringParam("pnam")="Mel's New Playlist"
  ae.RecordParam("prdt")=AERecordParam

  if ae.send then
    'it worked!
  else
    'oopsie
  end

Naturally, there's a plug here: this code is (mostly) courtesy of my application AE Monitor, which watches Apple Events on your system and converts them into usable REALbasic code. Check it out here:

http://software.oxalyn.com/AEMonitor/

Eric M. Williams
Oxalyn Software
http://software.oxalyn.com/

AE Monitor
http://software.oxalyn.com/AEMonitor/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to