@Shane
I’m sure that you know that but some readers may ignore it.
The Finder maintain a database of every name extension defined by the applications installed on the running machine.
As long of your application is not installed, “guillotine” is not identified as a name extension.
Such infos are given by the info.plist of every application in the array Exported Type UTIs.
For instance, in Preview’s plist, the first item of the array is the dictionary Item 0 (public radiance).
This dictionary contains a dictionary named Equivalent Types which itself contain an array of strings which are some of the name extensions which may be given to files exported by the app.
Here they are “pic”, “PIC”, “hdr”, “HDR”
In your app it would be “guillotine” (with perhaps its Uppercase version “GUILLOTINE”)
Complementary detail, if we uninstall the application, its set of extensions remains in the Finder’s database (the launchservices one if I remember well).
As System Events and Foundation are too lazy to use the informations available to both of them, they make no difference between a registered/identified extension and a standard string.
Jean-Paul Sartre wrote a play entitled “La P… respectueuse” (when he did we didn’t use ellipsis but 3 dots and France was ridiculous enough to refuse to write the word “Putain”)
If I saved a text file containing this play in old times, the file would have been named “La P… respectueuse” because in these old times Apple system didn’t use name extensions.
I have a lot of such old files and I never spent time to give them an extension.
As far as I know, nobody created an application using “respectueuse” as a name extension so, the Finder would be fair enough to know that the file has no extension.
The other tools, which may perfectly grab the info are too lazy to do that and would state that the file has the name extension “respectueuse” which is perfectly ridiculous and just prove their infamous laziness.
@KniazidisR
I apologize but I can’t check what you wrote.
I tried to urge the Finder to stop displaying name extensions.
I entered its Preferences pane and unchecked the dedicated checkbox and for safe, I rebooted
No luck, extensions were always displayed.
I entered the file com.apple.finder.plist and saw that the property AppleShowAllExtensions was set to YES. I edited it as NO, rebooted and extensions were always visibe.
The script below extracts the available settings and you will see that the results match what I wrote.
tell application "System Events" to tell process "Finder"
set frontmost to true
keystroke "," using {command down}
class of UI elements --> {window, menu bar, scroll area}
name of windows --> {"Préférences du Finder"}
tell window 1
class of UI elements --> {checkbox, checkbox, checkbox, checkbox, checkbox, checkbox, static text, pop up button, button, button, button, toolbar, static text}
tell toolbar 1
class of UI elements --> {button, button, button, button}
name of buttons --> {"Général", "Tags", "Barre latérale", "Options avancées"}
click button -1 --> "Options avancées"
end tell --> toolbar 1
class of UI elements --> {checkbox, checkbox, checkbox, checkbox, checkbox, checkbox, static text, pop up button, button, button, button, toolbar, static text}
title of checkbox 1 --> "Afficher toutes les extensions de fichiers"
value of checkbox 1 --> 0 -- unchecked
title of checkbox 4 --> "Avertir avant de vider la corbeille"
value of checkbox 4 --> 1 -- checked
end tell
end tell
set showExtensions to do shell script "defaults read com.apple.finder AppleShowAllExtensions"--> "0"
If I ask the Finder for the properties of a file, I get something like:
{class:document file, name:"|ContentsStoreFormat%1$@_loc|.txt", index:263, displayed name:"|ContentsStoreFormat%1$@_loc|.txt", name extension:"txt", extension hidden:false, container:folder "Desktop" of folder "**********" of folder "Users" of startup disk of application "Finder", disk:startup disk of application "Finder", position:{-1, -1}, desktop position:{1134, 768}, bounds:{-33, -33, 31, 31}, kind:"Document format texte", label index:0, locked:false, description:missing value, comment:"", size:674, physical size:4096, creation date:date "samedi 11 avril 2020 à 12:22:33", modification date:date "samedi 11 avril 2020 à 12:22:33", icon:missing value, URL:"file:///Users/**********/Desktop/%7CContentsStoreFormat%251$@_loc%7C.txt", owner:"**********", group:"(inconnu)", owner privileges:read write, group privileges:read only, everyones privileges:read only, file type:missing value, creator type:missing value, stationery:false, product version:"", version:""}
I may live with a system behaving this way but if you tell me what I must do to really stop the extensions display I would be glad to check how it behaves at script level.
Of course, after doing that I would return to my standard settings.
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) vendredi 24 avril 2020 15:11:06