When copying files in Finder, you might have noticed that the newly created, still-being-written-to files are âgrayed outâ, conveniently informing the user that the file is not ready yet.

I wanted to replicate that for an upcoming upgrade of Transloader (along with a progress indicator, as you can see in the screenshot above, but thatâs another topic), and after trying a couple of things, I found out how to do it.
I tested this on macOS High Sierra only, since itâs the OS version Iâm targeting right now, but I donât see a reason why it wouldnât work on earlier versions of macOS.
Itâs All in the Date
After digging around on the internet, I found that all that needs to be done is to change the fileâs creation- and modification dates to one specific date, namely:
January 24th, 1984, 09:00:00 AM

And it works great – the created file appears âgrayed outâ in Finder.
Thereâs a downside, however:
When copying a file in Finder, and trying to move that still-being-written-to file, Finder will display a convenient message that tells the user the file is in use and moving it might cause problems.
This doesnât happen when using this date-setting approach.
So I kept digging.
The Solution
What I did, then, was use Terminal and the âmdlsâ command to list the meta data of the still-being-written-to file:

At first, coming from the date-approach, I noticed the kMDItemFSCreationDate item, stating
1904-01-01 00:00:00 +0000
However, setting that as the creation date does nothing at all.
Then, I noticed the kMDItemFSCreatorCode and kMDItemFSTypeCode fields (red arrows in the screenshot of Terminal above).
Setting those like this…

…does exactly what I wanted – it ‘grays out’ the file in Finder, and displays the convenient Finder error message when trying to move it:

Mission accomplished – weâre done!
Please keep in mind, though, that the user may still choose âContinueâ to move the file, so you should definitely use an NSFileCoordinator to take care of that.