Skip to content
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

POT files are not previewed with Spotlight on macOS 12 #762

Open
DAnn2012 opened this issue Jul 9, 2022 · 4 comments
Open

POT files are not previewed with Spotlight on macOS 12 #762

DAnn2012 opened this issue Jul 9, 2022 · 4 comments
Labels

Comments

@DAnn2012
Copy link

DAnn2012 commented Jul 9, 2022

Hello @vslavik ,

I noticed that the contents of POT files are not previewed with Spotlight, while the contents of PO files are shown.

I'm using Poedit 3.1.1 on macOS Monterey 12.4 (21F79) on a Mac with Apple M1.

Thanks.

@vslavik vslavik added the macOS label Jul 9, 2022
@vslavik
Copy link
Owner

vslavik commented Jul 9, 2022

Please read this document (which GitHub asked you to do when you created this issue), follow the instructions therein and provide the missing detailed information, including any relevant files and detailed steps to reproduce. Thanks!

@DAnn2012
Copy link
Author

Hello @vslavik ,

thank you for the reply.

I think I have located the reason why the POT file content is not showing in previews on my Mac, this is due to Quick Look.

After searching the web, I found the following command: qlmanage -m and this is an extract from the result of this command:

server: living for 411s (3 requests handled) - instant off: yes - arch: ARM64 - user id: 501
memory used: 0 MB (595616 bytes) - used descriptors: 19/2560
last burst: during 0.007s - 1 requests - 0.000s idle
plugins:
...
  com.microsoft.powerpoint.pot -> /System/Library/QuickLook/Office.qlgenerator (46 - loaded)
...
  org.oasis.xliff -> /Applications/Poedit.app/Contents/Library/QuickLook/PoeditQuicklook.qlgenerator (6476)
...
  net.poedit.po -> /Applications/Poedit.app/Contents/Library/QuickLook/PoeditQuicklook.qlgenerator (6476)
...
  org.oasis-open.xliff -> /Applications/Poedit.app/Contents/Library/QuickLook/PoeditQuicklook.qlgenerator (6476)
...
  net.poedit.pot -> /Applications/Poedit.app/Contents/Library/QuickLook/PoeditQuicklook.qlgenerator (6476)

So, I think POT files, even though in my Mac they are regularly associated with Poedit as the default application, for Quick Look they are considered PowerPoint Templates (com.microsoft.powerpoint.pot) and try to open them exclusively for preview with that Office.qlgenerator.

I don't have PowerPoint in my Mac, but I think it is possible to open real PowerPoint template files with other applications I have installed (like Keynote and NeoOffice).

I don't know if I should use the commands to reset the Quick Look server's information (qlmanage -r), because I don't know if this could cause problems with previews of other document types.

For the moment, I have found that using this command from the Terminal: qlmanage -p -c net.poedit.pot filename.pot I can at least preview a single Poedit POT file.

Alternatively, by temporarily renaming the file from POT to PO, I am shown the preview directly from QuickLook, as a Poedit PO file.

I ask you and other Poedit users if anyone has encountered the same problem and how they have definitively solved it.

Thanks.

@vslavik
Copy link
Owner

vslavik commented Jul 11, 2022

Sorry, I should have realized this is about Office.qlgenerator myself, but I all too happily forgot about it. It, and macOS insistence that .pot files are com.microsoft.powerpoint.pot was always source of issues (any conflicting UTI declaration is just ignored), but previews did work in macOS 10.14, but indeed don't seem to in macOS 12.

I hope, but am not sure, that it will be possible to fix by migrating to the new Quick Look API introduced in macOS 10.15 and 12. It is plausible that new-style preview extensions will take priority over qlgenerators. If not, then there's probably nothing we can do.

@vslavik vslavik changed the title POT files are not previewed with Spotlight POT files are not previewed with Spotlight on macOS 12 Jul 11, 2022
@vslavik
Copy link
Owner

vslavik commented Jul 11, 2022

I'm less optimistic about the new API helping now. Apparently, nothing builtin uses it and everything qlmanage shows is still qlgenerators. Here's an Apple person saying that they're surprised this ever worked (for another filetype in a similar situation): https://developer.apple.com/forums/thread/124857 And this project encountered this issue for many filetypes starting with Catalina: https://github.com/sbarex/SourceCodeSyntaxHighlight#file-format-management

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants