obsidian-execute-code icon indicating copy to clipboard operation
obsidian-execute-code copied to clipboard

Adding prompt for permissions on MacOS

Open hvitis opened this issue 2 years ago • 2 comments

Hi,

when execuding blocks with Python code that utilize Mac's camera, I have problem with permissions. Debug info from apple error crash report:

This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an com.apple.security.device.camera key with a string value explaining to the user how the app uses this data.

I found here a fix that is mentioned for iTerm (which I use for the same code and works great)

Would it possible to add it to this plugin or this is Obsidian-related problem?

Thanks

hvitis avatar Apr 28 '23 16:04 hvitis

Could you give an minimal example of code which crashes?

mayurankv avatar Jun 05 '23 16:06 mayurankv

Hi,

the python code is executed as a normal command line program completely independent of Obsidian and the plugin. The plugin starts a process running your code and collects its output. I don't think the plugin can take influence on the permissions of the Python program (except by running it as a superuser).

I do not possess a mac and can therefore not implement this feature. If you find a solution for the problem feel free to create a merge request. Everyone reading this is of course also invited to create a merge request (for this or any other feature).

twibiral avatar Jun 05 '23 17:06 twibiral