Post

Replies

Boosts

Views

Activity

Unable to access related file in QuickLook Thumbnail Extension and QuickLook Preview Extension
Hi, I am developing QuickLook Thumbnail Extension and QuickLook Preview Extension which work with embroidery files. To prepare the view, I need to access stitches from the "stitch" file (supplied to my extension by system) and also to read the "colors" from related file (i.e. the file with different extension, but the same filename as "stitch" file). The embrodery is located stored in 2 files: squirrel.dst (stitchs) and squirrel.edr (colors). Is it even possible to extend sandbox in extensions for this task? I have tried to ask user to select folder in main.app (NSOpenPanel), create security-scoped Bookmark in main.app and access it from extension. However, this is not working - in the extension it is not possible to resolve the bookmark created in main.app. I have also tried to use mechanism for accessing related files as shown at https://developer.apple.com/documentation/security/app_sandbox/protecting_user_data_with_app_sandbox, using NSFilePresenter/NSFileCoordinator. It works in main.app, but doesn't work in QuickLook Thumbnail Extension and QuickLook Preview Extension. Is there any mechanism on Mac which would allow me to access more than the "supplied" file URL in QuickLook Thumbnail Extension and QuickLook Preview Extension? Ladislav
0
0
267
Jun ’24
Accesing Files in Thumbnail Extension and Quick Look Extension
I am developing Thumbnail Extension. To prepare a graphic (in .dylib) for file specified in URL.path I need to access second file, which has the same filename, but different extension. For example, I have "data" in file.*** and "colors" in file.yyy. Is it possible to read data from this second file while processing the first file in my extension? In my current implementation it sometimes works, but most of the time it doesn't work - it is not possible to read data from file.yyy when preparing thumbnail for file.***, causing exception in my .dylib routine. Is there some setting which would allow me to do this?
0
0
394
Jun ’24
Using .dylib in Quick Look Preview Extension target for macOS
I am developing "Thumbnail Extension" and "Quick Look Preview Extension" on Mac Apple M2 with Sonoma 14.5 These extension need 3rd party dynamic lib. (This .dylib I develop in Delphi FMX on Windows computer for macOS.ARM 64-bit architecture) I was able to drag & drop this .dylib to "Thumbnail Extension" target in XCode, "Embed & Sign" on "General" tab and then use dllopen/dlsym/dclose to use it in .swift code - and it works as expected, generating thumbnails for my custom extension files. However the same steps do not work for "Quick Look Preview Extension" target: The .dylib is drag & drop added to this target of my XCode project, "Embed & Sign" on "General" tab and build & run. I obtain "Previewer not found." dialog when SPACE-key viewing a file in Finder. (This happens even without calling dllopen/dlsym/dclose in my code.) After removing the .dylib from target "Quick Look Preview Extension" it works and shows my simple "generic hello world" graphic as Preview. I have checked the container of app bundle on disk to make sure that .dylib is on correct place, and it is: my.app/Contents/Plugins/Previewer.appex/Contents/Frameworks/libmydll.dylib The size of this .dylib is 13.5 MB The .appex and .dylib are both signed, using "Development" signing certficate. I am confused why this .dylib is working for "Thumbnail Extension" but not for "Quick Look Preview Extension". It seems to me that due to some reason system rejects to load this extension as soon as it contains .dylib, even without accessing it from my code.
1
0
267
Jun ’24