-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work on 10.15 #51
Comments
Is this what you're seeing @CarlosAMendoza? However, if I run |
No it does not work. GA Catalina. This is the error message I get:
EDIT: Command was |
I tried the steps from this issue in a related plugin and this time, I get a "this preview cannot be safely displayed in quick look" warning. |
While notarizing the app would get rid of that notification, I don't think it would solve the overall issue. You can disable that by running I'm able to preview the icon, but still no file preview when pressing space. I'm still getting the same file preview as above |
After looking around in the logs, I'm able to get this (this is for the
|
On CFDictionaryRef properties = (CFDictionaryRef)@{
(__bridge NSString *)kQLPreviewPropertyTextEncodingNameKey : textEncoding,
(__bridge NSString *)kQLPreviewPropertyMIMETypeKey : @"text/html",
}; |
after numerous attempts I have notarized the plugin. After the change I suggested above for adding the mime attribute now works on catalina! the steps are:
Build the plugin then create a zip: I use an Apple Developer Subscription account. I did not understand if it is possible to notarize with a free account. I have found more info for notarization on https://stackoverflow.com/a/56799591/1409904 Anyway Apple has deprecated all quicklook api like |
@sbarex the links are taking me to an issue search on this repo I'm enrolled in the dev program also, but I don't think it's possible to notarize without a paid developer account. There isn't really an official (or clear) statement from apple about it, but everything I've found on the internet points to needing a paid developer account to notarize. Are you not getting any errors in Console.app after adding in those lines? |
On Console.app, searching for com.apple.quicklook as suggested from qlmanage with -d arguments (that it is also deprecated...) don't show any errors when open a preview of a source file. But there are some errors when generating thumbnail on Finder with icon view (in detail view the associated application icons are shows for the file and not the preview):
The resulting icon are all black (i use the zenburn theme). |
I was able to get it working with your instructions @sbarex! |
Thanks for the help @sbarex - @anthonygelibert is there any chance that a notarized version of the binary will be published/released? Additionally, shouldn't disabling notarization |
A signed binary would be great for those who don’t have their own developer account. Also thank you for fixing the issue. |
Honestly, even though I have a developer account I would rather that the person responsible for past releases make a notarized binary available than building and notarizing this plugin myself, because then the notarization for the plugin is entirely within its actual developer’s account with Apple. I just don’t think that many people should notarize what is the same version of the same plugin, but maybe that is me just figuring it may come back to bite us at some point. Plus, the issue is with virtually all but one of the QuickLook plugins I had pre-Catalina. We can option-click apps to bypass the security settings stopping us from using them (or at least we could pre-Catalina, haven’t actually run into a need to do that yet on Catalina), but cannot for QuickLook plugins. So another fix would just be an update to Catalina allowing us to option-click plugins to bypass security checks. Unfortunately that doesn’t seem likely to ever happen. |
@alexclst I get what you're saying. I don't think @sbarex was suggesting everyone notarize it themselves (nor was I), but instead was showing how the issue can be resolved. I'm glad that they listed out the steps to "fix" the problem because there's not many other resources to help with a Quick Look problem like this one. Since Quick Look plugins are deprecated and will not working in future releases of macOS, it may not be worth @anthonygelibert's time and money to sign up for a developer account just to notarize QLColorCode, if he doesn't already have a developer account. |
Unfortunately I don't have a personal developer account to use to share the compiled version of the plugin and I can't use my company account for this. |
If the maintainer doesn't have the bandwidth to notarize this, perhaps someone from the community can request to become the maintainer or fork and notarize this themselves? |
I have very limited Objective C knowledge to be able to discern and code review PRs and issue fixes to bugs so I'm not so sure about doing this myself. |
@sbarex does qlcolorcode still work for you between reboots? Even if I'm able to get it working through building, signing, and notarizing the bundle, it doesn't work the next time I boot my mac up |
Apple’s sample code for Building an App Based on the Document Browser View Controller talks about previewing custom document formats. This is talking about iOS, but both iOS and macOS now seem to share the same Quick Look Preview Extension target type for building these new App Extension based Quick Look plugins that this sample code includes. I know nothing about the old .qlgenerator plugins at the source level, so would have no way of telling you how different or not this new API is from that which is now deprecated. |
I'm using catalina on vmware fusion for testing before upgrading my mac. For now after the full reboot of the virtual machine the plugin works correctly. |
Ok, I saw. I will try to migrate the code on the new system, apparently it does not seem a very complex operation. |
I had a look at migrating the code over, should not be too complex. I experimented with migrating the https://github.com/whomwah/qlstephen plugin and it was fairly easy. But with the plugins running in a sandbox you cannot just call the highlight tool as the path of the homebrew installation is not allowed to be called. I tried adding the binary to my project but it failed because it calls a dsym. Apparently compiling it so that is does not require the dsym is not easy. The easier solution would probably be to do a link to highlight in one of the allowed path from the sandbox, but this needs to be done manually by the user. |
I'm converted all objective-c code to swift and I have also implemented a switch for light/dark theme. To works the extension must be sandboxed. But a sandboxed code cannot execute shell process, not event call The advanced of extension is that it's embedded inside an app. So in this app is possible to create an interface to customize the extension (choose the theme for example). Now I need to make more test before relasing the code. |
The solution to embed |
I am by no means an expert - I just spend a couple of hours experimenting. At the end I also found XPC mentioned but did not have any time investigating more, maybe I should have mentioned this. I just wanted to share my insights in case in would help anybody, but seem you have already made more progress than I did :) Feel free to just put the code up, I can and would like to help testing or whatever else is needed |
hmm, no concrete idea. |
This is what
|
My project is not a simple fork of this repository but a different application (which uses the new catalina api for the quicklook extensions) that was inspired by part of this code. |
Using the original from
|
Ok, this opens a qlmanage preview window with the code in colours. However, the command line throws the following:
What doesn't work is preview using the space bar on a file to quicklook preview it with colours. Does this have to do with the directive |
Is there a step I am missing to allow quicklook preview of code in colours via spacebar on selected files in the finder? |
Ok. I got it to work. I had to add
This now allows to have colours in quicklook previews for shell scripts. I am missing colours for python (.py), latex (.tex), matlab (.m) and other languages. This would probably require similar additions into the Info.plist file, but I am not sure where to find which additions to make to the Info.plist file. Any good suggestions? |
For know the UTI of a file do this code in the terminal: |
Yes, this works (as indicated for another quicklook plugin here). In summary:
Now QLColorCode should work via spacebar (you might need to relaunch the finder). This indicates that the file Although it is possible to manually modify the Info.plist file, it would be great if an updated and verified Info.plist for Catalina could be made available. Does anyone know how to create a proper Info.plist for qlcolorcode on Catalina macOS 10.15? |
Thank you for this thread. I performed the above steps and now QLColorCode works with all of my source files (ino,cpp,h,c,cs...) |
Why dont you just create a pull request? |
Just adding: No you don't need to notorize the plugin for the If you need an example of how to configure the signing, have a look at my QLOPML plugin (which doesn't use notarization). |
Thanks @gbstan I add a bunch of extensions into Info.plist and it works great, except xml and plist files are still handled by the default system generator, even it should be handled by QLColorCode:
Any ideas? |
I don't really know why this is not dealt with by QLColorCode. Maybe there is an order list for certain files that the OS deals with in priority via its own internal preview? Or, you have certain files that are not captured by the above? |
According to what I found online If two or more generators can open the same UTI the order should be: |
@i0ntempest Did you try to restart your mac completely? Maybe that will fix the order. Another thing you can try is add the other types for xml as well:
And lastly, did you update Xcode recently? That may have changed the precedence? For me, |
@relikd You sure your plists are handled by Xcode? For me the generator in Xcode only handles provision profiles. Also I did all you suggested and still nothing. I even tried removing |
does it work if you force the generator? Though I don't know what to do if it works properly. I am assuming you already |
It does work if I force it, but the dyn type does nothing. Guess I'll have to live with it. |
I've forked this and added dark mode support and some more. It's more of a programming exercise for me but hopefully it's useful to someone. |
take a look at my repo sbarex/SourceCodeSyntaxHighlight |
Or simply zip files, delete original files and unzip. Works on Windows and Mac. |
Insanely late to the party but kulak's suggestion worked for me. |
Needs to be signed so macOS can use it.
The text was updated successfully, but these errors were encountered: