URL of track in AppleScript fails

Bug #514086 reported by David Kågedal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Play
New
Undecided
Unassigned

Bug Description

There is something wrong with the "URL" property of track objects in AppleScript. Try this in the AppleScript editor:

    tell application "Play"
 first track of library
    end tell

It will result in

    track id 1 of library of application "Play"

which is perfectly fine. This also works:

    title of first track of library

But this causes error -10000:

    URL of first track of library

This is Play Version 0.3 (1071)

Revision history for this message
David Kågedal (dkagedal) wrote :

I've been digging through the source and the documentation for various Cocoa APIs (I haven't developed for Mac since System 7 was new and shiny).

I finally managed to see this error reported in the debugger:

2010-01-30 23:40:31.507 Play[19318:80f] An exception was thrown during execution of an NSScriptCommand...
2010-01-30 23:40:31.508 Play[19318:80f] Error while returning the result of a script command: the result object...
file://localhost/Users/david/Music/eMusic/Ambrose%20And%20His%20Orchestra/The%20Hottest%20of%20the%20Decca%20M%20Series/Ambrose%20And%20His%20Orchestra_02_Mean%20to%20Me.mp3
...could not be converted to an Apple event descriptor of type 'text'. This instance of the class 'NSURL' doesn't respond to -scriptingTextDescriptor messages.

What I haven't been able to figure out is where the NSURL appears. The AudioStream has no "url" member, so it seems to come from the database mapping in DatabaseObject. But the SQL defines the url column as "text", and the sdef also declares it as "text". So where is the NSURL created?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.