File type problem

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

File type problem Sat Sep 02, 2023 5:52 am • by Trickyt57
I accidentally renamed thousands of files with the extension .pdf

These files originally had extensions like .doc, .xlsx, .mov, .jpeg, .mp4, and .pdf

How can I use Hazel to determine the file type? I have tried using "Kind ...is...." and "Kind... is not..." type rules, but these seem to just assume everything is a pdf file because of the extension.

I was hoping to find a "type is" rule.
Trickyt57
 
Posts: 56
Joined: Tue Sep 18, 2018 12:17 am

Re: File type problem Mon Sep 04, 2023 8:47 am • by Mr_Noodle
You'll probably need a script for this. There is the 'file' command which can try to figure out the type based on the file's contents.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: File type problem Wed Sep 06, 2023 4:24 pm • by Trickyt57
Hmmm... Scripts sound scary, I'm not sure where to start. I tried looking through this forum for s scripts tuorial, but I couldn't find any. I've no clue what the difference is between the different types of scripts. - Passes AppleScript , Passes JavaScript
Passes shell script etc.

Also I couldn't any "file comand in Hazel.
Trickyt57
 
Posts: 56
Joined: Tue Sep 18, 2018 12:17 am

Re: File type problem Thu Sep 07, 2023 8:32 am • by Mr_Noodle
It's in macOS, not Hazel. Here's a manual for the 'file' program. It's a bit more technical but should give you a sense of what it does: https://ss64.com/osx/file.html
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: File type problem Tue Sep 12, 2023 10:57 am • by Trickyt57
Mr_Noodle wrote:It's in macOS, not Hazel. Here's a manual for the 'file' program. It's a bit more technical but should give you a sense of what it does: https://ss64.com/osx/file.html

Many thanks for pointing me in the direction of this script! As you say, it looks daunting but I suppose I could learn it with some effort.
Trickyt57
 
Posts: 56
Joined: Tue Sep 18, 2018 12:17 am


Return to Support