Why can't DTTG 3.0.5 (and DT 3) simply read any TEXT file (regardless of extension)?

I’m baffled why a smart “AI” type program is incapable of showing you the content of any file that is TEXT. I have several files with extensions like “.PRG” that DTTG 3.0.5 (and DT itself!) just can’t handle – they both show nothing.
Can’t DT be a little smarter to “know” what a text file is and display it – rather than getting tripped up by a silly file extension?
I don’t get this. Seriously.

1 Like

And can you press the SpaceBar in the Finder with a .prg file selected and see anything?

Nope – In DT 3, pressing the spacebar just brings up a large white “icon window” with the name of the file at the bottom.

If you create a file with extension “.PRG” and put nothing but text in it, are you able to see that text under any circumstances (other than “Open with…”)?

In DTTG 3.0.5, I have no idea how to attempt to see anything.

I meant check it in the Finder, or is that what your ”Nope” is referring to?

1 Like

Oh, sorry for my confusion.

Nope, Finder doesn’t display it either.

This is just a text file so I’m still confused (baffled) why an AI-based product like DT can’t do a little introspection and realize … “Hey, this is a text file…display it!”.

Thanks,

DEVONthink gets its info from the operating system. A .prg is not some common format to macOS and there’s no Spotlight generator for it, and likely no Spotlight importer either.

Check out the Help > Documentation > Appendix > Hidden Preferences for a Terminal command to add specific extensions.

Apart from the AI moniker: a “text” file is at best a vague idea. What you consider to be text, is probably a sequence of bytes that convey meaning to you. Given that any file is only a sequence of bytes, deciding if something is a meaningful text in any of several hundred languages, a program, an image or something else entirely is not obvious for a machine. In some cases, it might not even be obvious to a human – would you be able to tell if a file contains a poem in Mandarin or a GIF only by looking at its bytes?
MacOS, like many Unixes, provides a program files that uses a ton of heuristics to figure out what the contents of a file might be. I doubt that finder uses that. It probably still relies on the old idea of looking at extensions (that was already a bad idea in MSDOSB and VMS).

1 Like

Right.

DT should just give you the >>> OPTION <<<< of a preview where DT (or DTTG) displays as best it can, whatever file it is. 100% of the files I would use this for, that are currently WORTHLESS in DT for viewing, would be text files that DT simply gives up on since it doesn’t have the right “extension” (or the Operating System isn’t helping either).
DT/DTTGO are both lazy software in this regard IMHO.
Come on guys, you can do better…(This is “AI” software, right? And, you can’t even figure out what a text file is??? )

Going “Jeeeez” impresses on me as somewhat belittling in this context, but I might just be being a little sensitive 🥸

Did you pick up upon the fact that you can solve this problem for yourself using the AdditionalPlainTextExtensions hidden preference in DT (although not in DTTG to my knowledge)?
I have no doubt DTs programmers could help DT identify files which can usefully be displayed as plain text. Why doesn’t it already, then? Presumably because other things seemed more important to implement. For my use case I would agree with that decision. You for yours don’t.

Your feature request is for a “display as plain text” button or menu entry if I understand you correctly? That could easily be scripted in DT, but I don’t have a solution for DTTG handy.

3 Likes

Why should text file extensions be a (seemingly mysterious) hidden and not a default capability of a powerful software program? To wit, why shouldn’t the software do more without me “scripting” or “finding hidden extensions?”
What I’m suggesting is that anytime DT/DTTG can show a preview of a file, it should “know” what a text file is or at least go ahead and try to display the file – even if it’s garbage – if that’s what the user wants. I can view any kind of file in, say, BBEDIT, even though it may not be “readable”.
I know this might not be an easy task, but DT is an advanced program. Perhaps it could read the first “x” bytes in a file and if all fall within in a certain range, it could decide it’s a text file. Just a starting point idea.

(Note: My “Jeeez” above was not directed at any person. Sorry if that came across negatively. I was just expressing my opinion that DT misses the mark on what should be default obvious file display behavior. Again, just my opinion.)

So you’d rather have DT display the content of a file that has the extension PDF or JPG as meaningless garbage just because PRG files in your case contain text? I’m not so sure that this would be considered helpful by many people.
BTW, there are 10 different versions of PRG files (PRG File - What is a .prg file and how do I open it?). Why would DT prefer text over any other possible content here?

2 Likes

I’m really just saying it would be nice if DT would try to figure out if it’s a text file and display it.

2 Likes

That’s a much nicer way of saying it :relieved: thank you :slight_smile:

2 Likes

Most (well designed) binary files have known headers. Often the first word is distinctive.

However, detecting filetype by reading the first few bytes is best handled by the operating system. We’re a long ways off from the heady days of of resource forks and other viable alternatives to extensions.

1 Like

Thanks for your input on that so I could clarify. :slight_smile:

I remember the days when file extensions were a Windows thing and the odd feeling when it became something Macs started to use more and more. :open_mouth: :slight_smile:

2 Likes

maybe a checkbox “interpret this as an ascii file” might be useful.

Deliberately excluding all languages that use non-ASCII, like French, Spanish, Russian, Chinese, Thai, German… in fact, you’d have to offer far more possibilities than ASCII, namely all the ISO-Latin variants and utf-8, maybe even utf-16, and also the older codings for CJK, possibly Cyrillic, Hebrew and Arab.
As much as I find the fixation on file extensions stupid, in the case of the original poster they should simply tell finder that PRG is a text file and tell DT to treat it as such.

2 Likes

Why not just have DTTG have a “Preview” long-press option. If you select it, you get DT’s best attempt at displaying the file. For me, I know which files that would display correctly (like a Visual FoxPro “PRG” (program) file) and, like trying to show a binary file in BBEDIT, would be willing to accept the risk of seeing garbage displayed if I selected the wrong file.

And nowhere, an earnest request for OP to stand-down & restate :wink:

DT figured out a long time ago their success is predicated on making life better. That’s why they’re Kong in this space.

2 Likes