Re: AppleScriptObjC -- List Folder Handler
Re: AppleScriptObjC -- List Folder Handler
- Subject: Re: AppleScriptObjC -- List Folder Handler
- From: Shane Stanley <email@hidden>
- Date: Tue, 04 Dec 2018 10:17:48 +1100
On 4 Dec 2018, at 5:27 am, Christopher Stone <email@hidden>
wrote:
>
> Not according to my tests with Sierra.
>
> On my system the Finder and List folder produce the same output no matter how
> show filename extensions is set, although they do have different sort
> characteristics.
Did you test it with a file where Hide Extension is clicked in its Get Info box?
> And this is exactly what I want. I want the true file name
Who knows what the *true* file name is? It's irrelevant. What matters is that
the API you use to get the name is the same API used by the code you're going
to use it in.
In maybe 90-99+ per cent of cases, the differences don't matter. If you don't
use : or / in filenames, you don't hide extensions, and you are on an English
system, they're all interchangeable. That's why so many scripts work, but are
actually buggy.
List folder uses the old Carbon APIs, which are now deprecated. Pretty much
everything else is likely to be using POSIX-based stuff, or more likely the
higher-level NSURL APIs, and converting to and from HFS stuff just for
AppleScript. Obviously of you use "do shell script" or ASObjC, you're going to
get POSIX values, unless you ask for the localized name.
The «class furl» is a good example. (Last I looked, System Events returned
lastPathComponent for the name property, including : instead of /.)
So if you want to play with HFS paths using TIDs, you should work with HFS
paths. If you're planning to use the name to do a metadata search, say, you
should use lastPathComponent. But if you don't, most times it probably won't
matter.
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
_______________________________________________
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