I’m trying to write a script that will do the following with a file:
-
Get the name extension of the file.
-
Test whether the name extension of the file is present in launch services’ list of extensions that it recognizes.
-
If the extension of the file IS in launch services’ list, the script will add a new extension to the existing filename and extension.
So, for example, if a file is named
MySampleFile.TXT
the script will rename the file to
MySampleFile.TXT.newextension
(of course “newextension” is merely an example to show what I mean).
But if a file is named
MySampleText.strange
and “.strange” is not in launch services’ list of known extensions, then the script will NOT change the name of the file.
If anyone knows a way to create a list of all extensions known to launch services, I would be very grateful to have it.
Thank you.