I have a code:
func openGetInfoWnd(for urls: [URL]) {
let pBoard = NSPasteboard(name: NSPasteboard.Name(rawValue: "pasteBoard_\(UUID().uuidString )") )
pBoard.writeObjects(urls as [NSPasteboardWriting])
NSPerformService("Finder/Show Info", pBoard)
}
this code opens multiple windows of Finder's "Get Info"
like it displays on Cmd + I hotkey
How can I open single one window ("Show Inspector" / "Get Info" / "Multiple Item Info") for multiple local urls?
Like it displayed on Cmd + Option + I press in Finder
PS: code: NSPerformService("Finder/Show Inspector", pBoard) ofc does not work :)

Tried many ways, you are right, NSPerformService is very limited, and cannot achieve it. And I also tried
Apple Script's approach:But that only works for the single file and there is no open "multiple information window" thing in Finder.
Luckily, your keyboard shortcuts remind me that I can simulate the file selection and keyboard keydown events.
So I believe below apple script can help you:
I think you can call this create this apple script in Swift and call it.
Here is a useful link to call it in swift: