PDA

View Full Version : Loading File From URL / Scripting Bridge




bgibbs
Jan 2, 2009, 10:19 AM
Hi,

I'm trying to create a humble app to organize DVDs and launch them in Apple's DVD Player.app using Scripting Bridge. I can control a movie once it's playing, but I keep getting an error when trying to load a disc using a URL:

Apple event returned an error. Event = 'dvdx'\'odvf'{ '----':'utxt'("file://localhost/Volumes/Movies/FullDisc/High%20Fidelity/VIDEO_TS") }
Error info = {
ErrorNumber = -1700;
}


The explanation for ErrorNumber -1700 reads:

Data could not be coerced to the requested descriptor type

This happens whether or not I include the VIDEO_TS at the end.

In the DVDPlayer.h header, the openDvdVideoFolder: says it takes an NSURL as a parameter, which is what I'm passing it, so, I don't understand the error message. Any ideas?

Thanks.



whooleytoo
Jan 5, 2009, 01:02 PM
I'm completely unfamiliar with scripting, so this could be way off; but are you using the right kind of NSURL? (i.e. did you create the NSURL using one of the "URLWithString" methods, or "fileURLWithPath" methods?)

I've found some classes/methods are fussy about which they receive.

cazlar
Jan 5, 2009, 05:45 PM
Yeah, I think whooleytoo is on the right track.

Something like:
"file://localhost/Volumes/Movies/FullDisc/High%20Fidelity/VIDEO_TS" is defined as a path, not a NSURL.

Sayer
Jan 5, 2009, 08:33 PM
Take out the "localhost" part and try it.