How to get the names of items in a Finder selection.
How to get the names of items in a Finder selection.
- Subject: How to get the names of items in a Finder selection.
- From: Michelle Steiner <email@hidden>
- Date: Sun, 24 Dec 2000 12:49:33 -0800
If you use "the selection" you will get a list containing the full path
name of each item in the selection. Then you have to extract the item
names from the list.
tell application "Finder"
the selection as alias list
end tell
--> {alias "Dora:Graphics:", alias "Dora:Games :", alias
"Dora:Documents:", alias "Dora:Installer Logs:"}
Here's a simple way to get a list of only the item names.
tell application "Finder"
activate
copy
set x to the clipboard
end tell
--> "Documents
Games
Graphics
Installer Logs"
As an added bonus, it alphabetizes the list for you.
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | Hard as it may be to believe, my |
| email@hidden | life has been based on a true story. |
----------------------------------------------------------------------