Can not find reference 'NSWorkspace' in '_init_.py'

33 Views Asked by At

from AppKit import NSWorkspace I am trying to import NSWorkspace from the AppKit but getting error as unable to find reference. I am using python 3.12 with pyobjc version 10.0

Expecting it should work as I am using it in activeAppName = NSWorkspace.sharedWorkspace().activeApplication()['NSApplicationName'] but since it is not accessible I am not sure whether it is working.

0

There are 0 best solutions below