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: "John S. Baltutis" <email@hidden>
- Date: Mon, 28 Oct 2002 01:25:14 -0800
I did some further checking of my cases and found that I reported the
outputs from the event log and not the outputs from the result box. For
example:
OS 9.2.2/AS 1.8.3
Case 3:
tell application "Finder"
get every item of desktop whose kind is not "disk"
end tell
event log: --> {trash, file " Apple OSX dmg ", file "Script Editor"<snip
every other thing on desktop that's not a disk>}
results: -->{trash of application "Finder", file " Apple OSX dmg " of
application "Finder", file "Script Editor" of application "Finder"<snip
every other thing on desktop that's not a disk>}
Every item is identified by type and has "of application "Finder" appended;
not exactly what one would want if only the names were desired. Stripping
these with TIDS should work, but I'm a newby with those.
However, this does work, albeit slowly:
tell application "Finder"
set n to count of items in desktop
set theList to {}
set x to (get kind of startup disk)
repeat with i from 1 to n
set theList to (theList & (name of item i in desktop (OPT L)
whose kind is not x))
end repeat
end tell
result-->{"Trash", " Apple OSX dmg ", "10.2 fixes", "Script Editor"<snip
every other thing on desktop that's not a disk>}.
Haven't looked at OS X's behavior.
HTH
_______________________________________________
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.