I am making a QuickLook plugin that will be included with my application. It will be used to preview a file type that other applications also have QuickLook plugins for. Every time I attempt to test with my plugin (I put it into ~/Library/QuickLook/) it previews with another app's plugin. I am using qlmanage to preview. Is there a way to force it to use mine, at least for testing?
To install QuickLook plugins, you should copy the “*. qlgenerator” file into /Library/QuickLook/ or ~/Library/QuickLook/. Note that “*” in the filename will vary based on exactly which QuickLook item you choose to install. If a QuickLook folder is not present, feel free to create one.
On your Mac, select one or more items, then press the Space bar. A Quick Look window opens.
QuickLook looks for and uses the plugins from both system-wide folders '/System/Library/QuickLook' and '/Library/QuickLook' and also the home folder of each user in '~/Library/QuickLook'. A QuickLook plugin is organised in a folder with an extension .
The easiest solution to fix macOS Monterey Quick Look not working is to restart Finder. Doing so will also refresh Quick Look as it is part of Finder's feature. To restart Finder, you need to locate the Finder icon on your Dock, right-click it while pressing the Option key, then choose Relaunch.
While the order of precedence described by @julien is accurate, it is still possible to override a particular application's QL provider. Simply edit the Info.plist
file in the .qlgenerator
of the offending application. For example, I like the way a certain QL provider handles markdown, but one of the text editors I have installed includes (imho) less than stellar markdown support. My preferred bundle loses... until I edit:
/Applications/BadMarkdown.app/Contents/Library/QuickLook/BadMarkdownQL.qlgenerator/Contents/Info.plist
and remove
<string>net.daringfireball.markdown</string>
And in newer versions of OS X, you don't even need to restart the QL daemon. The preferred QL tool just takes over. =D
Generators embedded in applications are always preferred to plug-ins in ~/Library/QuickLook (which are preferred to the ones in /Library/QuickLook, which are preferred to the ones in /System/Library/QuickLook).
There is no way to change this priority. Also if 2 generators at the same level claims the same type of file, Quick Look will prefer one over the other, whichever you can't control.
At least for your test, you can force qlmanage to use the plug-in you want by using the -g
option (but you will also have to specify the content-type with -c).
Try qlmanage -h
to get all the options for your tests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With