Re: filtering a list of items with Finder
Re: filtering a list of items with Finder
- Subject: Re: filtering a list of items with Finder
- From: has <email@hidden>
- Date: Sat, 26 Oct 2002 14:54:16 +0100
Chris Page wrote:
>
> I'm not sure, but I think something's not right with the application
>
> object's properties.
[...]
>
With Mac OS X 10.2.2, AppleScript 1.9, I get:
>
>
tell application "Finder"
>
get class of desktop --> desktop
Oh good, looks like it's fixed. It was just something I noticed while
poking around, thought I should mention it.
>
For grins, outside of a tell block:
>
>
class of desktop --> constant
I think this 'desktop' constant is defined in Standard Additions' path to
command. Gotta love that swampy namespace...<g>
-----
Going back to the OP's question: filtering by 'kind' seems to work okay,
although in OS X the name used is "Volume" while OS 9 uses "disk" [1].
Tentatively then, and with a view to cross-compatibility:
get items of desktop whose kind is not in {"disk", "Volume"}
(Anyone - esp. with non-English system - want to confirm/deny this reliably
works everywhere?)
has
[1] Arbitrary(?) changes like this makes me wonder if the kind property is
stable or not... it'd be really funny to recommend its use, only to
discover later that the damn thing is multi-lingual or something else
equally untrustworthy. Another reason why I wish filtering by class would
work... comparing constants is pretty much foolproof, whereas comparing
strings in AS makes me downright jittery. Wonder why it doesn't?
--
http://www.barple.pwp.blueyonder.co.uk -- The Little Page of AppleScripts
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.