[TxMt] Re: Code preview in Finder

John DeSoi desoi at pgedit.com
Mon May 11 14:05:27 UTC 2020


> On May 10, 2020, at 8:25 PM, Allan Odgaard <mailinglist at textmate.org> wrote:
> 
> It might be that BBEdit adds the four character type code to the file.
> 
> In a terminal try run this before/after saving with BBEdit: GetFileInfo -t <file>

Yes! Before: "\0\0\0\0" and after: "TEXT"


> 
> Also, what extension does files (without) code preview have?

The file extension is ".4dm" which is a 4D method source file. It is part of a new text based project format 4D introduced with 4D 18:

https://doc.4d.com/4Dv18/4D/18/Exporting-structure-to-text-files.300-4575705.en.html

4D forms are stored in .4DForm files which are really just JSON files. I added that extension to the JSON bundle and the .4DForm files properly show in the Finder preview. But they also show "\0\0\0\0" for GetFileInfo. I'm not seeing that my 4D bundle does anything different from the JSON bundle.

The 4D Info.plist info for these file types are included below. Thanks for any further insight to solving this.

John DeSoi, Ph.D.


<dict>
  <key>UTTypeConformsTo</key>
  <array>
    <string>public.source-code</string>
  </array>
  <key>UTTypeDescription</key>
  <string>4D Method</string>
  <key>UTTypeIdentifier</key>
  <string>com.4d.4d.method</string>
  <key>UTTypeTagSpecification</key>
  <dict>
    <key>public.filename-extension</key>
    <array>
      <string>4DMethod</string>
      <string>4dm</string>
    </array>
  </dict>
</dict>

<dict>
  <key>UTTypeConformsTo</key>
  <array>
    <string>public.json</string>
  </array>
  <key>UTTypeDescription</key>
  <string>4D Form</string>
  <key>UTTypeIdentifier</key>
  <string>com.4d.4d.form</string>
  <key>UTTypeTagSpecification</key>
  <dict>
    <key>public.filename-extension</key>
    <array>
      <string>4DForm</string>
    </array>
  </dict>
</dict>









More information about the TextMate mailing list