• 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: name extension
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: name extension


  • Subject: Re: name extension
  • From: kai <email@hidden>
  • Date: Wed, 4 May 2005 23:28:16 +0100


On Wednesday, May 4, 2005, at 10:42 pm, Michelle Steiner wrote:

If foo doesn't have a name extension,

Tell application "Finder" to get name extension of foo
--> ""

name extension of (info for foo)
--> missing value

How come the difference?

Good question.

For this job I used 'info for', rather than Finder, because it proved to be generally faster. However, the speed advantage is dented by that ghastly check for a missing value - which also makes the script longer than it would otherwise need to be. On top of that, the line looks downright ugly (IMO). ;-)

I now see that Nigel suggested a similar approach before I did. (Mail didn't group his reply with the others from the same thread, so I missed it first time around.) His version is much prettier, of course. ;-)

---
kai

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: name extension
      • From: Michelle Steiner <email@hidden>
References: 
 >name extension (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Nice Automator article on O'Reilly
  • Next by Date: Re: Using AS to logout
  • Previous by thread: name extension
  • Next by thread: Re: name extension
  • Index(es):
    • Date
    • Thread