Post

Replies

Boosts

Views

Activity

Reply to IOKIT Detecting BSD(unix) name for USB Serial Device with PID and VID
I know I'm late to this IOKit party, but the following Swift code (I'm new to Swift, so point out any better practises if you see I'm doing something horrendously wrong) works for me to retrieve the IODialinDevice... var dict : Unmanaged<CFMutableDictionary>?       if (IORegistryEntryCreateCFProperties(usbDevice, &dict, kCFAllocatorDefault, 0) == KERN_SUCCESS)       {         let hardDict = (dict?.takeRetainedValue()) as! NSMutableDictionary         DispatchQueue.main.async {           self.deviceLabel.stringValue = self.deviceLabel.stringValue + (hardDict["IODialinDevice"] as! String) + "\n"         }       } For my test purposes I had the deviceLabel (an NSTextField) updating just to make sure I was receiving Add and Remove Messages. Hope this helps others as the Apple docs on IOKit are really abysmal in helping people with this low level stuff.
Oct ’21
Reply to Are BNDL just a different type of APPL?
I hope I’m understanding this correctly…. It would appear that BNDLs are actually just a folder structure with an executable/binary (and other things perhaps), similar to APPLs. BUT, what has me a bit baffled right now is the difference between a BNDL and an APPL is that an APPL has a main function to kick things off, but a BNDL does not (or I can’t see one in a BNDL's xcode project)? So other than mentioning the NSPrincipalClass in the info.plist, when during the BNDL’s lifecycle does that specified PrincipalClass get instantiated?
Dec ’19
Reply to NSDockTilePlugin tutorial....
Hi Jana, If I'm not mistaken that code is about updating the DockTile Menu, while the application is running. While what I'm looking for is updating the DockTile menu while the application is NOT running. Which requires a NSDockTilePlugin implementation. You can see this by making sure System Preferences is not running, then Control-&gt;Click the dock tile, it still displays a comprehensive menu, even though System Preference is not running. This then allows you to Jump to specific area within Preferences and only at that point does it then launch System Preferences itself and short-cut you to the right place. That is the behavior I'm looking for 🙂
Dec ’19
Reply to NSDockTilePlugin tutorial....
After further Googling I found a github repo that contained a DockTilePlugin Sample that was 7 years old. I have updated the sample so that it builds and runs with XCode 11 and enhanced it slightly to suit my needs, as I wanted to be able to dynamically update the App's DockTile menu when the app isn't running.I hope others find this update sample useful.The updated project, with the original author's ReadMe.rtf can be found on GitHub here -https://github.com/CartBlanche/MacDockTileSampleIf someone with more Objective C experience can look over the code and tell me if there are better ways of doing things, I'll update the code, or send me a PR.
Dec ’19
Reply to Are BNDL just a different type of APPL?
After a bit more Googling I found a DockTile plugin example that is 7 years old and looking through the code it seems to have the actual DockTilePlugin project set up as a BNDL. Hence the question. The BNDL looks to be a Target, within the APPL and saves itself inside the APPL's Contents/Plugins folder.I'm in the process of updating that sample so that it builds and runs with the current Xcode, so will update my other question, once I have it working.
Dec ’19
Reply to NSDockTilePlugin tutorial....
Yes I found that SO and the link. I've added a comment to the SO, to ask the OP to upload the working version of the sample to a repo somewhere. We'll see if he's still around and still uses SO.I'm unfamiliar with how to use either developer contact or how to burn a DTS ticke. Do you have links on how to do both?
Dec ’19
Reply to NSDockTilePlugin tutorial....
Hi Claude, thanks for taking the time to reply.The dynamic solution works at runtime and I used that example to get it working for mine. But if you have a look at Xcode when it is totally shut-down, it still shows a list of most recently opened projects. Some people call them Jump Lists. My limited understanding is that this uses NSDockTilePlugins and other than the documentation here - https://developer.apple.com/documentation/appkit/nsdocktileplugin?language=objc - there really is no step by step guide showing how they can be implemented. The docs say that from 10.6, this is the "preferred" method.
Dec ’19