I am using Python 2.7 with pyobjc in the Lion Center and NSNotification to monitor any inserted USB volumes. It works great.
I also have ideas on how to get the serial number of the device, but they only include parsing all USB devices. I would like to specifically request only the inserted device (the one who creates the notification), and not check the entire list of USB devices.
How can I do that? The object NSNotificationpassed to the function of my handler does not have such information, and I could not find any information about it above with the information provided by the object NSNotification.
I tried DBus (as I did on Linux), but I was not lucky that it works reliably on OSX.
source
share