Re: Capturing File Names
Re: Capturing File Names
- Subject: Re: Capturing File Names
- From: email@hidden
- Date: Fri, 16 Aug 2002 01:30:49 EDT
In a message dated 8/15/2002 Keith writes:
>
I'm having a bit of trouble trying to do what seems pretty basic. Maybe
>
it's not. What I need to do is capture the file name of files that are
>
being dropped into a droplet. I need the true name, not the path.
>
I need to use this information to send commands thru a telnet app.
Some say ask the Finder. Others will say use info for. I say: Use whatever's
handy:
on open (theItem)
tell application "Finder" to set fName to name of item 1 of theItem
set oName to name of (info for theItem)
display dialog "Finder says:" & fName & " is the name" buttons "OK"
default button "OK"
display dialog "Info for says:" & oName & " is the name" buttons "OK"
default button "OK"
end open
I didn't know until just now that "info for" somehow coerces a list of one
alias into one alias. That's probably not a real useful feature since a
proper droplet should account for the possibility that some users will drop
one item at a time and some will drop great gobs of items.
HTH
Robert Kyle
Star Tribune
Minneapolis
_______________________________________________
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.