Here is simplified checking. The principle is simple - I know: when my phone named Samsung Galaxy J3 is connected, then System Profiler report contains following substring (which includes “Connected: Yes” in it).
I got this substring running do shell script “/usr/sbin/system_profiler SPBluetoothDataType” when my phone was connected (cutting control substring from the result). Then I use this substring to check if my phone is connected later:
set sRes to do shell script "/usr/sbin/system_profiler SPBluetoothDataType"
return sRes contains "Samsung Galaxy J3 (2016):
Address: 08-78-08-00-AA-5B
Major Type: Phone
Minor Type: Smartphone
Services: SMS/MMS Message Access, Android Network User, Headset Gateway, AV Remote Control Target, OBEX Object Push, OBEX Phonebook Access Server, Android Network Access Point, Handsfree Gateway, Advanced Audio
Paired: Yes
Configured: Yes
Connected: Yes"
No, it’s not yours, but my fault. You explained everything correctly, but I did not understand you, because I never connected the phone to the computer through a cable. You will need help from other users. By the way, bluetooth connection is also a special case of a USB connection. That’s why I didn’t understand you.
So a device does show up called “iPhone” when connected to the usb. But it doesn’t have an unique identifiers that the iPhone itself have. The serial numbers don’t even match. iPhone has 12 characters for serial number while the output of the serial number is 40 characters in the output.
Thanks for the response. But it grabs the header of "USB Product Name" = "iPhone" it’s a bit generic it would be helpful if the name of the actual device would have displayed.
I have no unique identifier that I can see how to identify which IOS device. Unless I take the unique identifier that is displayed as the device identifier?