whomwah / qlstephen

A QuickLook plugin that lets you view plain text files without a file extension
https://github.com/whomwah/qlstephen
MIT License
2.75k stars 161 forks source link

macOS X 10.15 Catalina support? #81

Closed silviu-bucsa closed 4 years ago

silviu-bucsa commented 5 years ago

On the Public betas of Mac OS X QLStephen.qlgenerator stopped working. I've attached a screenshot with the message I'm receiving:

Screenshot 2019-07-09 at 08 58 07

I haven't found a workaround.

Thank you.

7xanthus commented 4 years ago

I've been experimenting with a fresh macOS Catalina install on a vm and these are the steps I can reliably make QLStephen work:

  1. brew cask install qlstephen
  2. Restart Finder
  3. Open a finder window and navigate to any folder that contains a plaintext file qlstephen tries to generate a preview for. Maybe you need to trigger Quicklook explicitly by selecting the file and hitting space.
  4. This will generate an error message saying the developer can't be verified. From "move to trash" and "cancel" choose "cancel"
  5. Open System Preferences -> Security & Privacy and under the General tab at the Botton click "Allow anyway"
  6. Log out and log back in
  7. Repeat step 3
  8. In the warning message that now appears choose "open"

Everything should be working now. If you don't have a clean install and you can't trigger the first error message anymore I would uninstall QLStephen first and restart your Mac.

Btw, depending on factors I'm not entirely sure about you can sometimes skip step 2 and/or 6

Try this and not work for QLimagesize

gustavohellwig commented 4 years ago

I've been experimenting with a fresh macOS Catalina install on a vm and these are the steps I can reliably make QLStephen work:

  1. brew cask install qlstephen
  2. Restart Finder
  3. Open a finder window and navigate to any folder that contains a plaintext file qlstephen tries to generate a preview for. Maybe you need to trigger Quicklook explicitly by selecting the file and hitting space.
  4. This will generate an error message saying the developer can't be verified. From "move to trash" and "cancel" choose "cancel"
  5. Open System Preferences -> Security & Privacy and under the General tab at the Botton click "Allow anyway"
  6. Log out and log back in
  7. Repeat step 3
  8. In the warning message that now appears choose "open"

Everything should be working now. If you don't have a clean install and you can't trigger the first error message anymore I would uninstall QLStephen first and restart your Mac.

Btw, depending on factors I'm not entirely sure about you can sometimes skip step 2 and/or 6

Guys, sorry but I lost my brain, there is something that we are missing. I did also a new VM, and did this:

` /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

brew cask install betterzip created a test .zip test pressing Space nothing happened relunched Finder nothing happened opened once the Betterzip unckecking everything test pressing Space nothing happened relunched Finder Worked

brew cask install QuickNFO created a test .nfo test pressing Space nothing happened relunched Finder nothing happened brew cask install qlcolorcode created a test .js test pressing Space nothing happened relunched Finder error about permission show up authorized in Settings/Security test pressing Space nothing happened relunched Finder nothing happened restarted the VM error about permission show up / clicked open test pressing Space this error below show up Screen Shot 2019-10-25 at 9 29 05 AM brew cask install quicklook-json created a test .js test pressing Space nothing happened relunched Finder Worked but....after other instalation below, this stopped to work. What is the logic?

brew cask install qlimagesize created a test .nfo test pressing Space nothing happened relunched Finder nothing happened

brew cask install quicklook-csv created a test .nfo test pressing Space nothing happened relunched Finder nothing happened

brew cask install suspicious-package created a test .zip test pressing Space nothing happened relunched Finder nothing happened opened once the suspicious-package app test pressing Space nothing happened relunched Finder Worked

brew cask install qlstephen created a test README test pressing Space nothing happened relunched Finder error about permission show up authorized in Settings/Security test pressing Space nothing happened relunched Finder nothing happened restarted the VM error about permission show up / clicked open test pressing Space this error below show up Screen Shot 2019-10-25 at 12 46 27 PM

`

like...in my real computer, the only thing that it's working is: qlmarkdown suspicious-package provisionql QuickLookAddict

So....what are we missing?

jorge-d commented 4 years ago

Hi there,

The box "qlstephen cannot be opened because its from an unidentified developer" with button "OPEN ANYWAY" wasn't appearing in my Security and privacy.

I managed to make it work in my machine doing this:

Cheers,

orome commented 4 years ago

@jorge-d Doesn't work.

kevnm67 commented 4 years ago

I've been following and attempting most of the suggested solutions without any success... until just now. I did the following:

Removing and reinstalling quicklook plugins seemed to make the difference. That and attempting to reload quicklook + relaunch finder multiple times. Sorry for the non-specific potential fix but hope it helps someone. It's been driving me crazy.

gustavohellwig commented 4 years ago

no lock from me again.

llamafilm commented 4 years ago

In the mean time, to get around this, you can go to the folder (⌘⇧G from Finder) ~/Library/Quicklook/QLStephen.qlgenerator/Contents/MacOS/ and right-click QLStephen, selecting Open. This will give you the option to open it anyway, and it should load correctly in the future.

For me this was not enough. I had to open the binary like this and also open the bundle. Right-click QLStephen.qlgenerator and open with BBEdit, accept the warning. Now it works.

gustavohellwig commented 4 years ago

In the mean time, to get around this, you can go to the folder (⌘⇧G from Finder) ~/Library/Quicklook/QLStephen.qlgenerator/Contents/MacOS/ and right-click QLStephen, selecting Open. This will give you the option to open it anyway, and it should load correctly in the future.

For me this was not enough. I had to open the binary like this and also open the bundle. Right-click QLStephen.qlgenerator and open with BBEdit, accept the warning. Now it works.

I did that and still doens't work for me.

humiaozuzu commented 4 years ago

simple way to fix this warning is to run xattr -d com.apple.quarantine ~/Library/QuickLook/QLStephen.qlgenerator

gustavohellwig commented 4 years ago

simple way to fix this warning is to run xattr -d com.apple.quarantine ~/Library/QuickLook/QLStephen.qlgenerator

no success here.

lucky13820 commented 4 years ago

I've been following and attempting most of the suggested solutions without any success... until just now. I did the following:

  • open ~/Library/QuickLook/ and removed QLMarkdown.qlgenerator, which I was about to reinstall. It probably makes sense to delete any non-working .qlgenerator.
  • ran qlmanage -r
  • relaunched finder
  • reinstalled quicklook plugin(s)
  • ran qlmanage -r + relaunched finder
  • invoked quicklook on a few files. NOTE: it didn't immediately seem to work so I repeated the previous step 1-2 times. After relaunching finder for the 2-3rd time and invoking quicklook it decided to work.

Removing and reinstalling quicklook plugins seemed to make the difference. That and attempting to reload quicklook + relaunch finder multiple times. Sorry for the non-specific potential fix but hope it helps someone. It's been driving me crazy.

Hi there,

The box "qlstephen cannot be opened because its from an unidentified developer" with button "OPEN ANYWAY" wasn't appearing in my Security and privacy.

I managed to make it work in my machine doing this:

  • brew cask reinstall qlstephen
  • Relaunch Finder
  • sudo spctl --master-disable # disable gatekeeper
  • ensure that it works by doing a quicklook on a random file
  • sudo spctl --master-enable # plug gatekeeper back
  • then opening the "Security and Privacy" did contain the "OPEN ANYWAY" button on the bottom

Cheers,

After tried those two suggestions, qlstephen seems to works fine. Thank.

frankrolf commented 4 years ago

I have a feeling two problems are conflated here:

I just did some tinkering and realized that QLStephen will work on non-suffixed files following this suggestion: https://github.com/whomwah/qlstephen/issues/81#issuecomment-552341771 However, QLStephen won’t work for files with arbitrary extensions – .fea in my case.

I tried re-assigning the default opening application – no luck just yet. I’d be curious to find out how to permanently force QuickLook to use a specific generator for a given file type.

acecilia commented 4 years ago

I have been doing some debugging. @frankrolf you are right.

The way QuickLook selects a plugin to generate a preview is by matching the LSItemContentTypes properties in the Info.plist of QLStephen with the kMDItemContentType property of a file, which you can obtain by doing mdls -name kMDItemContentType myFile.

For example, if a file has a value of public.data for the kMDItemContentType property, QLStephen will be used to preview it (because public.data is under the LSItemContentTypes property of the Info.plist).

I noticed that yml files have the property kMDItemContentType set to public.yaml, and thus they are not opened with QLStephen. Also, some files have a dynamic value for kMDItemContentType, as you can read here, and they are not opened with QLStephen.

A solution that works for me is to add some extra values to the Info.plist of QLStephen:

<key>LSItemContentTypes</key>
<array>
    <string>public.data</string>
    <string>public.yaml</string>
    <string>com.apple.xcode.strings-text</string>
    <string>dyn.ah62d4rv4ge81e3pxr70hq3pe</string>
</array>

Find the plugin attached here with those changes: QLStephen.qlgenerator.zip

Remember that every time that a plugin is changed, Finder has to be restarted.

Also, find here a script to read the kMDItemContentType property of multiple files:

for f in *; do
  type=$(mdls -name kMDItemContentType $f)
  echo "$f -> $type"
done
jtphoenixga commented 4 years ago

@samcat116

Notarization does not require the $99/yr subscription. Just needs an Developer Apple ID and Xcode .

You are kidding right? You only get a valid developer id, when you pay $99 for the Apple Developer program.

I have a valid developer id and I didn't have to pay the $99.

neslob commented 4 years ago

(just posted my solution in another issue https://github.com/anthonygelibert/QLColorCode/issues/51#issuecomment-563982425)

Removing the quarantine attribute from all files is another solution, to get Quicklook working. No need to change any code.

List attributes xattr -r ~/Library/QuickLook/QLColorCode.qlgenerator

Delete attribute com.apple.quarantine xattr -d -r com.apple.quarantine ~/Library/QuickLook/QLColorCode.qlgenerator

gititaivan commented 4 years ago

(just posted my solution in another issue anthonygelibert/QLColorCode#51 (comment))

Removing the quarantine attribute from all files is another solution, to get Quicklook working. No need to change any code.

List attributes xattr -r ~/Library/QuickLook/QLColorCode.qlgenerator

Delete attribute com.apple.quarantine xattr -d -r com.apple.quarantine ~/Library/QuickLook/QLColorCode.qlgenerator

It doesn't work for me. :(

chris-gillatt commented 4 years ago

Hi there,

The box "qlstephen cannot be opened because its from an unidentified developer" with button "OPEN ANYWAY" wasn't appearing in my Security and privacy.

I managed to make it work in my machine doing this:

* `brew cask reinstall qlstephen`

* Relaunch Finder

* `sudo spctl --master-disable` # disable gatekeeper

* ensure that it works by doing a quicklook on a random file

* `sudo spctl --master-enable` # plug gatekeeper back

* then opening the "Security and Privacy" did contain the "OPEN ANYWAY" button on the bottom

Cheers,

Similar to this I did the following to get mine to show the elusive button: brew cask remove qlstephen && brew cask install qlstephen Open finder so that the cannot be opened because the developer cannot be verified error Opened up System Preferences > Security and Privacy > General tab Then there was a button at the bottom right of that box, next to text of the app which was blocked (qlstephen). Clicked allow and it now works fine.

This issue is affecting many applications (including big ones like Terraform).

skywinder commented 4 years ago

simple way to fix this warning is to run xattr -d com.apple.quarantine ~/Library/QuickLook/QLStephen.qlgenerator

Works for me! DOn't forget killall Finder in the end!

setanarut commented 4 years ago

simple way to fix this warning is to run xattr -d com.apple.quarantine ~/Library/QuickLook/QLStephen.qlgenerator

Works for me! DOn't forget killall Finder in the end!

I tried and it works on Catalina 10.15.1

leirissa commented 4 years ago

not on 10.15.2 :-(

setanarut commented 4 years ago

@leirissa is gatekeeper disabled? sudo spctl --master-disable gatekeeper jpg

ballo commented 4 years ago

I installed QLStephen.qlgenerator via brew in 10.15.2 Gatekeeper is disabled I clicked a README file (public.data) and pressed space I cannot view the file in QL

What am I doing wrong?

leirissa commented 4 years ago

indeed I am stucked as well,,,,e.g bla.conf files are showing the default app icons ( e.g sublime) but no preview...changing to xml and , bang ,,,ok

setanarut commented 4 years ago

not on 10.15.2 :-(

@leirissa I updated macOS to 10.15.2 and it works. (i downloaded QLStephen.qlgenerator.1.4.4.zip with safari and installed manually.)

ballo commented 4 years ago

I did: brew cask reinstall qlstephen and re-launched the Finder. No-go! spctl --status assessments disabled

ballo commented 4 years ago

compiled quickview that won't load: https://drive.google.com/open?id=1eo6q4JNmLxl_5EdAj3sRU0jtNzRgNj0U

setanarut commented 4 years ago

compiled quickview that won't load: https://drive.google.com/open?id=1eo6q4JNmLxl_5EdAj3sRU0jtNzRgNj0U

@ballo sorry I meant the text file without extension. it shows the files without the extension I created myself. maybe there is something different in your file.

for example; touch testfile echo "hello world" >> testfile

ballo commented 4 years ago

mdls -name kMDItemContentType README kMDItemContentType = "public.data"

setanarut commented 4 years ago

mdls -name kMDItemContentType testfile kMDItemContentType = "public.data"

leirissa commented 4 years ago

oke, so how to open a file with .conf ( mapped with sublime and only shows the icon)

ballo commented 4 years ago

mdls -name kMDItemContentType blah.conf kMDItemContentType = "dyn.ah62d4rv4ge80g55sq2" Screen Shot 2020-01-06 at 11 17 44 AM

setanarut commented 4 years ago

qlstephen is for files without extension?

ballo commented 4 years ago

@hazarek Look up "kMDItemContentType"

setanarut commented 4 years ago

@hazarek Look up "kMDItemContentType"

so?

ballo commented 4 years ago

It isn't the "extension"

setanarut commented 4 years ago

it does not show files with the conf extension because The plugin does not support.
out

ballo commented 4 years ago

Is there a different app that uses quick look plugins which logs their loading, or is it all done by the system and thus a black box

leirissa commented 4 years ago

strange, before catalina this works!

ballo commented 4 years ago

I'm regretting Catalina very day. The 32bit absence has killed a lot of functionality like 32bit mplayer (old codecs) and WINE.

Keep it up Apple; Windows is looking better every 'upgrade'

setanarut commented 4 years ago

@ballo https://iina.io/. why do you use old fashioned mplayer.

ballo commented 4 years ago

@hazarek I use it when old win32 codecs are necessary. There's a compatibility layer.

I guess I should say used since Catalina makes it impossible now. I'll have to use Linux in a virtual machine, or figure out a downgrade method (which may be tricky since I never used Mojave)

fregante commented 4 years ago

Solution

Make sure you follow each step correctly. Please don't leave more unnecessary comments so that new users will see this one.

  1. Install the plugin (brew cask install qlstephen)
  2. Select a file without an extension. macOS will show a warning like this one.
    • DO NOT CLICK "Move to Trash"
    • Click "Cancel" Cannot be opened because the developer cannot be verified.
  3. Open System Preferences
  4. Visit Security & Privacy
  5. Ensure you're in the General tab. You should see a notice regarding this plugin at the bottom:
    • Click "Allow Anyway" qlgenerator was blocked from use because it was not from an identified developer
  6. Select another file without extension OR run: qlmanage -p /path/to/file/without/extension
  7. You should see a warning similar to the first one, but with a new button
    • Click "Open" 🎉 Are you sure you want to open it
  8. Enjoy QuickLooking extension less files on Catalina qlgenerator on catalina
ballo commented 4 years ago

'Select a file without an extension. macOS will show a warning like this one. DO NOT CLICK "Move to Trash"'

nope

ballo commented 4 years ago

Yeah, maybe on your machine but not mine.

readeral commented 4 years ago

I had no issue with @fregante instructions - worked perfectly

varyform commented 4 years ago

xattr -cr ~/Library/QuickLook/QLStephen.qlgenerator This worked as for all other apps with same issue

ballo commented 4 years ago

@varyform Can you confirm whether or not you saw the "cannot be opened" error and if your solution is for people who have seen the error?

I have yet to see that error.

carlos-crespo commented 4 years ago

@ballo I wasn't able to see the error either, but @varyform 's command worked for me.

ballo commented 4 years ago

Doesn't help here.

I also tried moving all contents from ~/Library/QuickLook/ into ~/Library/QuickLook.old/ and reinstalling QLStephen.qlgenerator from brew. It reinstalled but same non-function and non-error.

lloydsargent42 commented 4 years ago

@fregante Instructions worked for me.