I have folders, containing files and folders.
Among these files, some have extension, some have no extension.
I noticed that a file without extension can have a type (probably stored in some kind of metadata)
Example of a TextEdit file without extension :
Example of a Document Sublime Text file without extension :
What I want is recursively exploring folders and changing the type of files without extension.
I am not talking about setting a default app for all files without extension.
I am talking about changing each file individually (metadata), to set there type to "Document Sublime Text"
I am looking for something like that :
find ./ -depth <file has no extension> -exec <set file type = Document Sublime Text>
Or an AppleScript !
Best Answer
I did it with xattr ! My final script is :
Replace FOLDER by your folder (containing files without extension) (drag and drop)
Replace FILEWITHGOODTYPE by a file which has the expected type (drag and drop)
I found what I was looking for here :
https://stackoverflow.com/q/4833052/4135158