I'm working on an Xcode extension, which needs to get the project path, i.e. the path of the project/workspace from which you run the extension command which I'm making. I've tried something like this:
let workspace = NSWorkspace.shared()
let path = workspace.absolutePathForApplication(withBundleIdentifier: Bundle.main.infoDictionary!["CFBundleIdentifier"] as! String)
but it just returns nil. I have also tried getting it via the FileManager, but it just returns a path of the extension.