doublecmd icon indicating copy to clipboard operation
doublecmd copied to clipboard

MacPreview stopped working for the files it used to work

Open antonklimov opened this issue 9 months ago • 20 comments

Version

Double Commander Version: 1.1.14 gamma Revision: 468 Commit: edd44b0e2 Build date: 2024/05/04 Lazarus: 3.99.0.0 FPC: 3.2.2 Platform: aarch64-Darwin-cocoa OS version: Mac OS X 14.4.1

Description

Something happened with MacPreview probably around 1.1.13, since it still works for me on 1.1.12. When viewing files MacPreview doesn't seem to work for most of the files just shows the file in the internal viewer and selecting Plugin->MacPreview doesn't do anything. Somehow it still works for .csv, not sure about other file types.

antonklimov avatar May 07 '24 18:05 antonklimov

What file type does not work? Also execute in the terminal and copy here:

qlmanage -m plugins

alexx2000 avatar May 07 '24 18:05 alexx2000

plugins: org.sil.ukelele.keylayout -> /Applications/Ukelele.app/Contents/Library/QuickLook/Ukelele Quick Look Generator.qlgenerator (1) org.openxmlformats.presentationml.slideshow -> /System/Library/QuickLook/Office.qlgenerator (47) com.adobe.pdf -> /System/Library/QuickLook/PDF.qlgenerator (986.5.2) com.apple.localized-pdf-bundle -> /System/Library/QuickLook/LocPDF.qlgenerator (986.5.2) com.apple.iwork.keynote.key -> /System/Library/QuickLook/iWork.qlgenerator (237.6) com.apple.application -> /System/Library/QuickLook/StandardBundles.qlgenerator (986.5.2) com.apple.ical.bookmark -> /System/Library/QuickLook/iCal.qlgenerator (986.5.2) com.microsoft.word.doc -> /System/Library/QuickLook/Office.qlgenerator (47) com.microsoft.powerpoint.pot -> /System/Library/QuickLook/Office.qlgenerator (47) org.openxmlformats.wordprocessingml.template.macroenabled -> /System/Library/QuickLook/Office.qlgenerator (47) com.apple.iwork.keynote.sffkey -> /System/Library/QuickLook/iWork.qlgenerator (237.6) com.apple.ichat.ichat -> /System/Library/QuickLook/iChat.qlgenerator (5500) com.microsoft.word.dot -> /System/Library/QuickLook/Office.qlgenerator (47) com.apple.iwork.keynote.sffkth -> /System/Library/QuickLook/iWork.qlgenerator (237.6) org.openxmlformats.presentationml.template.macroenabled -> /System/Library/QuickLook/Office.qlgenerator (47) com.apple.keynote.key -> /System/Library/QuickLook/iWork.qlgenerator (237.6) com.apple.iwork.pages.sfftemplate -> /System/Library/QuickLook/iWork.qlgenerator (237.6) public.movie -> /System/Library/QuickLook/Movie.qlgenerator (986.5.2) com.apple.iwork.keynote.kth -> /System/Library/QuickLook/iWork.qlgenerator (237.6) com.apple.iwork.numbers.sffnumbers -> /System/Library/QuickLook/iWork.qlgenerator (237.6) com.apple.package -> /System/Library/QuickLook/Package.qlgenerator (986.5.2) org.openxmlformats.wordprocessingml.document.macroenabled -> /System/Library/QuickLook/Office.qlgenerator (47) com.apple.iwork.pages.sffpages -> /System/Library/QuickLook/iWork.qlgenerator (237.6) com.apple.ical.ics -> /System/Library/QuickLook/iCal.qlgenerator (986.5.2) org.oasis-open.opendocument.text -> /System/Library/QuickLook/Text.qlgenerator (986.5.2) org.openxmlformats.wordprocessingml.template -> /System/Library/QuickLook/Office.qlgenerator (47) com.apple.ical.ics.event -> /System/Library/QuickLook/iCal.qlgenerator (986.5.2) com.microsoft.excel.xlt -> /System/Library/QuickLook/Office.qlgenerator (47) com.apple.iwork.numbers.sfftemplate -> /System/Library/QuickLook/iWork.qlgenerator (237.6) com.apple.iwork.keynote.key-tef -> /System/Library/QuickLook/iWork.qlgenerator (237.6) com.apple.internet-location -> /System/Library/QuickLook/Clippings.qlgenerator (986.5.2) com.rsa.pkcs-12 -> /System/Library/QuickLook/Security.qlgenerator (55185) org.openxmlformats.presentationml.slideshow.macroenabled -> /System/Library/QuickLook/Office.qlgenerator (47) com.microsoft.word.stationery -> /System/Library/QuickLook/Office.qlgenerator (47) public.x509-printable-encoded-archive -> /System/Library/QuickLook/Security.qlgenerator (55185) public.xml -> /System/Library/QuickLook/Text.qlgenerator (986.5.2) org.openxmlformats.wordprocessingml.document -> /System/Library/QuickLook/Office.qlgenerator (47) com.apple.rtfd -> /System/Library/QuickLook/Text.qlgenerator (986.5.2) com.apple.garageband.project -> /Applications/GarageBand.app/Contents/Library/QuickLook/GarageBandQLGenerator.qlgenerator (5961) com.apple.systempreference.prefpane -> /System/Library/QuickLook/StandardBundles.qlgenerator (986.5.2) org.openxmlformats.spreadsheetml.template -> /System/Library/QuickLook/Office.qlgenerator (47) com.apple.keychain -> /System/Library/QuickLook/Security.qlgenerator (55185) public.font -> /System/Library/QuickLook/Font.qlgenerator (986.5.2) public.x509-certificate -> /System/Library/QuickLook/Security.qlgenerator (55185) com.apple.iwork.pages.template -> /System/Library/QuickLook/iWork.qlgenerator (237.6) com.adobe.illustrator.ai-image -> /System/Library/QuickLook/Illustrator.qlgenerator (986.5.2) public.vcard -> /System/Library/QuickLook/Contact.qlgenerator (986.5.2) com.apple.finder.textclipping -> /System/Library/QuickLook/Clippings.qlgenerator (986.5.2) org.openxmlformats.presentationml.template -> /System/Library/QuickLook/Office.qlgenerator (47) org.openxmlformats.spreadsheetml.template.macroenabled -> /System/Library/QuickLook/Office.qlgenerator (47) com.apple.iwork.numbers.numbers -> /System/Library/QuickLook/iWork.qlgenerator (237.6) com.apple.iwork.pages.pages -> /System/Library/QuickLook/iWork.qlgenerator (237.6) com.apple.ichat.transcript -> /System/Library/QuickLook/iChat.qlgenerator (5500) com.apple.iconset -> /System/Library/QuickLook/Icon.qlgenerator (986.5.2) com.apple.addressbook.group -> /System/Library/QuickLook/Contact.qlgenerator (986.5.2) com.apple.property-list -> /System/Library/QuickLook/Text.qlgenerator (986.5.2) com.apple.addressbook.person -> /System/Library/QuickLook/Contact.qlgenerator (986.5.2) public.html -> /System/Library/QuickLook/Web.qlgenerator (986.5.2) com.apple.iwork.numbers.template -> /System/Library/QuickLook/iWork.qlgenerator (237.6) com.microsoft.powerpoint.pps -> /System/Library/QuickLook/Office.qlgenerator (47) public.plain-text -> /System/Library/QuickLook/Text.qlgenerator (986.5.2) public.audio -> /System/Library/QuickLook/Audio.qlgenerator (986.5.2) com.apple.pict -> /System/Library/QuickLook/Clippings.qlgenerator (986.5.2) public.xhtml -> /System/Library/QuickLook/Web.qlgenerator (986.5.2) com.apple.logicx.project -> /Applications/GarageBand.app/Contents/Library/QuickLook/LogicXQLGenerator.qlgenerator (5961) org.openxmlformats.presentationml.presentation.macroenabled -> /System/Library/QuickLook/Office.qlgenerator (47) com.apple.tv.movpkg -> /System/Library/QuickLook/Movie.qlgenerator (986.5.2) com.apple.finder.pictclipping -> /System/Library/QuickLook/Clippings.qlgenerator (986.5.2) com.apple.ical.bookmark.todo -> /System/Library/QuickLook/iCal.qlgenerator (986.5.2) com.apple.iwork.numbers.numbers-tef -> /System/Library/QuickLook/iWork.qlgenerator (237.6) public.json -> /System/Library/QuickLook/Text.qlgenerator (986.5.2) org.openxmlformats.presentationml.presentation -> /System/Library/QuickLook/Office.qlgenerator (47) com.apple.webarchive -> /System/Library/QuickLook/Web.qlgenerator (986.5.2) com.apple.private.live-photo-bundle -> /System/Library/QuickLook/LivePhoto.qlgenerator (986.5.2) public.svg-image -> /System/Library/QuickLook/Web.qlgenerator (986.5.2) public.image -> /System/Library/QuickLook/Image.qlgenerator (986.5.2) com.apple.garageband.template.magic -> /Applications/GarageBand.app/Contents/Library/QuickLook/GarageBandQLGenerator.qlgenerator (5961) org.openxmlformats.spreadsheetml.sheet -> /System/Library/QuickLook/Office.qlgenerator (47) com.microsoft.excel.xls -> /System/Library/QuickLook/Office.qlgenerator (47) org.openxmlformats.spreadsheetml.sheet.macroenabled -> /System/Library/QuickLook/Office.qlgenerator (47) public.rtf -> /System/Library/QuickLook/Text.qlgenerator (986.5.2) com.apple.iwork.pages.pages-tef -> /System/Library/QuickLook/iWork.qlgenerator (237.6) com.microsoft.powerpoint.ppt -> /System/Library/QuickLook/Office.qlgenerator (47) public.comma-separated-values-text -> /System/Library/QuickLook/Office.qlgenerator (47) com.apple.ical.ics.todo -> /System/Library/QuickLook/iCal.qlgenerator (986.5.2) com.apple.garageband.template.magicmentor -> /Applications/GarageBand.app/Contents/Library/QuickLook/GarageBandQLGenerator.qlgenerator (5961)

antonklimov avatar May 08 '24 16:05 antonklimov

It doesn't work for .go, .md, .yml. For other files it used to open .js in MacPreview, now it shows it with highlighting in an internal viewer, but in any case it doesn't give a choice to use a plugin. And I am running both versions 1.1.12, and 1.1.14 side by side and see the difference.

antonklimov avatar May 08 '24 16:05 antonklimov

Also execute command like this (for each file type .go, .md, .yml .js):

mdls -name kMDItemContentTypeTree /path/to/some/file.go

How this file types looks in the Quick Look? Can you attach screenshots?

alexx2000 avatar May 08 '24 17:05 alexx2000

mdls -name kMDItemContentTypeTree ./csvTesting.go kMDItemContentTypeTree = ( "org.go.source", "public.source-code", "public.plain-text", "public.text", "public.data", "public.item", "public.content" )

antonklimov avatar May 08 '24 18:05 antonklimov

image

antonklimov avatar May 08 '24 18:05 antonklimov

mdls -name kMDItemContentTypeTree ./README.md kMDItemContentTypeTree = ( "net.daringfireball.markdown", "public.plain-text", "public.text", "public.data", "public.item", "public.content" )

antonklimov avatar May 08 '24 18:05 antonklimov

image

antonklimov avatar May 08 '24 18:05 antonklimov

mdls -name kMDItemContentTypeTree ./.gitpod.yml kMDItemContentTypeTree = ( "public.item", "public.yaml", "public.data", "public.text", "public.content" )

antonklimov avatar May 08 '24 18:05 antonklimov

image

antonklimov avatar May 08 '24 18:05 antonklimov

mdls -name kMDItemContentTypeTree ./babel.config.js kMDItemContentTypeTree = ( "com.netscape.javascript-source", "public.script", "public.source-code", "public.plain-text", "public.text", "public.data", "public.item", "public.content", "public.executable" )

antonklimov avatar May 08 '24 18:05 antonklimov

image

antonklimov avatar May 08 '24 18:05 antonklimov

The screenshots are not QuickLook they are what I see with Double Commander 1.1.12. QuickLook is similar: image

antonklimov avatar May 08 '24 18:05 antonklimov

@antonklimov can you please add all the mentioned problematic files as attachments here so it is easier to check for regressions next time? Thank you!

lprot avatar May 11 '24 06:05 lprot

I guess Text.qlgenerator supports syntax highlighting in the new macOS versions. But I don't sure that we should change something (except markdown). DC has built-in code viewer with syntax highlighting which has a more features.

alexx2000 avatar May 11 '24 10:05 alexx2000

The problem is not about how the files are rendered. The problem is that there is a plug-in which can render some files, but the newer versions of commander do not make it selectable. So even if internal viewer has support for a file type is it a good reason for blocking MacPreview on the same file? Can't we have both?

antonklimov avatar May 11 '24 18:05 antonklimov

We don't know which plain-text file types Quick Look supports. It does not have explicit definition for specified file types ( .go, .md, .yml).

MacPreview used for all supported file types except plain-text. Plain-text are opened using internal Viewer.

alexx2000 avatar May 11 '24 19:05 alexx2000

What do you mean by which plain-text file types Quick Look supports? Is it necessary for plug-in to function? How did it use to work in 1.1.12 then? If I go to Finder it has Quick Look available on all the files. And why plain-text files have to be opened only by internal Viewer, what is the problem of allowing them to be opened in the plug-in?

antonklimov avatar May 13 '24 17:05 antonklimov

I mean what plain-text files it can display with syntax highlighting. Under macOS 11 Quick Look displays all text files as simple text with limited functionality.

Version 1.1.12 and lower had a bug, Quick Look had been called for every text file and totally broke Viewer functionality. You cannot copy/search text using plugin, can't go to line number etc.

DC is not Finder. DC has its own internal viewer, while Quick Look is only an additional capability.

alexx2000 avatar May 14 '24 04:05 alexx2000

Quick Look does not have to display all text files as simple text. It depends on which extensions are installed. For instance I have "Syntax Highlight.app", "PreviewText.app", "QLMarkdown.app" and I posted the snapshots which show the results. Double Commander could simply allow to show what Quick Look renders. As a workaround I created a toolbar button which resolves to "qlmanage -p %p", and gave it option-F3 key shortcut, so it's not a problem for me anymore, though I don't understand why it could not be a functionality supported out of the box.

antonklimov avatar May 16 '24 18:05 antonklimov