• 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: Getting file suffix
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting file suffix


  • Subject: Re: Getting file suffix
  • From: KOENIG Yvan <email@hidden>
  • Date: Tue, 14 Sep 2010 16:55:24 +0200

>
> Le 14 sept. 2010 à 16:39, Ronald Hofmann a écrit :
>
>> This is what I ended up with though, which I think will be safest in all cases:
> What do you mean by this?
> Do you assume the Finder´s 'info for' will some day not work the same way it is doing now???
> But you assume that 'text item delimiters' will always work?
>
> This is strange. Do you distrust functions generally?
> What you do is just a workaround for somebody who doesn´t know the finders 'info for.
>
> On the other hand, your workaround might not work anymore someday when things change.
> But Finder functions will surely adopt to such changes.
>
> Your handler delivers for my artifical file "MacOSX:Users:ronny:Desktop:myFile.honeypot" the extension 'honeypot'. This is the same what the Finder does. What obviously is wrong. May be there is someday a change in MacOSX to recognize correct extensions. But than your handler will still fail while 'info for' will do alright.
>
> My proposal:
>
> set thePath to choose file with prompt "Choose File please..."
> set theSuff to getSuffix(thePath)
>
> on getSuffix(thePath)
> 	tell application "Finder"
> 		return (name extension of (info for thePath))
> 	end tell
> end getSuffix
>
> Greetings, Ronald
> ---

(1) "info for" is not a Finder's function.

so,

> on getSuffix(thePath)
> 	tell application "Finder"
> 		return (name extension of (info for thePath))
> 	end tell
> end getSuffix

is odd.

If you want to use info for, better use it the correct way ;-)

> on getSuffix(thePath)
> 	return (name extension of (info for thePath))
> end getSuffix


(2)  "info for" is a DEPRECATED Standard Addition feature.
So, YES, we must assume that one day it will no longer be available.

Yvan KOENIG (VALLAURIS, France) mardi 14 septembre 2010 16:55:18





 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: Getting file suffix (From: Shane Stanley <email@hidden>)
 >Re: Getting file suffix (From: LuKreme <email@hidden>)
 >Re: Getting file suffix (From: "Mark J. Reed" <email@hidden>)
 >Re: Getting file suffix (From: LuKreme <email@hidden>)
 >Re: Getting file suffix (From: Ronald Hofmann <email@hidden>)

  • Prev by Date: Re: Getting file suffix
  • Next by Date: Re: Getting the maximum value and minimal values in a list
  • Previous by thread: Re: Getting file suffix
  • Next by thread: Re: Getting file suffix
  • Index(es):
    • Date
    • Thread