Re: Finder Info to get real audio media source URL
Re: Finder Info to get real audio media source URL
- Subject: Re: Finder Info to get real audio media source URL
- From: Matt Deatherage <email@hidden>
- Date: Sun, 7 Aug 2005 22:14:32 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 8/7/05 at 8:23 PM, Laine Lee <email@hidden> wrote:
> On 8/7/05 6:16 PM, "deivy petrescu" <email@hidden> wrote:
>
> >
> > Try this:
> > <script>
> > set l to alias "MyStartupDisk:Users:justme:Desktop:listen.ram"
> > set theURL to read l
> > </script>
> >
>
> THAT is why I won't do two shows a night any more, baby! Nope, I won't, I
> won't!
>
> (It works!)
>
> Thanks!
>
> I'd still like to know if there's any documentation describing a way to get
> Applescript to grab that new Finder info window stuff. Maybe in one of
> Matt's future books.
OK, there are so many concepts being mixed up in this thread that my mailbox now thinks it's a blender, and yet delicious smoothies are not pouring forth.
1) Although some Web browsers past and present put a downloaded file's URL into its Finder comments, Safari does not do that. The new "Where From" part of the General Info panel in Tiger is from *Spotlight*. It's part of the item's metadata, and is set by Safari. I don't know if other browsers set it or not, but there's no reason they can't.
Try this in Terminal if you have Tiger's developer tools installed:
mdls -name kMDItemWhereFroms ~/Desktop/listen.ram
That's where Finder gets the URLs you're seeing.
2) Most .ram, .ra and similar RealAudio files are nothing more than short text files that contain the URL of the _stream_ that RealPlayer should play when you open the file. Deivy's script above simply reads the contents of the file. That gives you the URL of the audio stream, *not* of the .ra file that you downloaded.
Furthermore, if the RealAudio file is more complex, perhaps with some presentational or video stuff, the "read l" command above will not return a URL, but a bunch of other stuff.
OK, so there are two concepts, but it was enough.
The OS does not force programs that download files to store the URL for those files anywhere - in a comment, in Spotlight, anywhere. Programs that use Spotlight's methods, like Safari in Tiger, make it possible to find it with command-line tools and hopefully, someday, through native Spotlight AppleScript properties. Programs that don't leave you high and dry.
The *contents* of a file rarely have anything to do with the file's location on the internet. For those .ra files that just contain a stream, the above script lucks out. For others, it will make you very sad.
I feel better now.
- --Matt
- --
Matt Deatherage <email@hidden>
GCSF, Incorporated <http://www.macjournals.com>
"There must be a difference between leadership and evil, but I don't know
what it is." -- Scott Adams
-----BEGIN PGP SIGNATURE-----
Version: PGP Desktop 9.0.2 (Build 2425)
iQA/AwUBQvbOZuQJS+YigHjzEQIwPACdGSpI2H+T+P7th7Vy4Qi/NeFj5aIAn1QB
JJ7tUmHnxHLf6KqYNVVdW53d
=IxWW
-----END PGP SIGNATURE-----
_______________________________________________
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