• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Capturing File Names
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Capturing File Names
      • From: John Delacour <email@hidden>
  • Prev by Date: RE: Output to PDF/PostScript (I WANT REAL ANSWERS!)
  • Next by Date: Re: Perl or Applescript w/ Excel
  • Previous by thread: Capturing File Names
  • Next by thread: Re: Capturing File Names
  • Index(es):
    • Date
    • Thread