Re: iTunes: database ID equivalent for playlists?
Re: iTunes: database ID equivalent for playlists?
- Subject: Re: iTunes: database ID equivalent for playlists?
- From: has <email@hidden>
- Date: Sat, 16 Apr 2005 10:53:13 +0100
Stephen Jonke wrote:
>You couldn't just keep track of playlists by full reference?
>
>I tried that, but it doesn't really work. It works for some things, but not for others. For example I find that when using the reference returned by the "make new playlist", any attempt to copy tracks to the playlist via that referece do not work - nothing is copied into the playlist! Example:
>
>set thePlaylist to make new playlist with properties {name:"Test Playlist"}
>copy every track of playlist 1 to thePlaylist
'copy' is not an application command; all the above does is get a list of playlist 1's tracks, then copy it to thePlaylist variable. Use 'duplicate', which is:
duplicate every track of playlist 1 to thePlaylist
AppleScript tries to be clever by mapping 'copy' to 'duplicate' when it's obvious that you really mean the latter. However there are often cases where your intent isn't so obvious, so all this really does is end up causing a lot of confusion for users. Simple rule: only use copy when you intend to assign a copy of an AppleScript value to an AppleScript variable; don't use it where you really mean 'set' or 'duplicate'. You'll have fewer problems that way.
>AppleScript sure can be flakey....
Bugs and stupid design features aside, the AppleScript language itself is actually pretty simple and straightforward. Most of the major difficulty users have is in dealing with applications that have weird, broken and/or poorly or incorrectly documented scripting interfaces; stuff that's not AS's fault at all. In this case, the problem's a small but significant bug in iTunes' dictionary (forgetting to list an id property on the appropriate classes; trivial to fix). Feel free to submit a bug report to Apple on this; the more folk get onto developers to fix their bugs, the likelier they are to do it.
HTH
has
--
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
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