ThRuST Well-Known Member Licensed User Longtime User Nov 25, 2016 #1 How to open any of the drives to browse contents on a Mac? I've heard that Finder is equal to Explorer on a PC but how is this done? What I try to do is to add a list of available units that will be shown in a trayicon, which should work on both PC and Mac. For example the following drive info should be accessible from both PC and Mac: * Available partition * Drive name * Available space * Total space When an item in the list is clicked, the contents should be shown in finder on Mac and Explorer on PC. Also how does this work on Linux and perhaps if Java works on Ubuntu and other platforms? Btw the equality to Taskbar in Windows should be the 'Dock' on Mac. I assume it can be rightclicked and selected just as in the trayicon on PC!!! What I do is to check OS and set a global flag: Code: Copy ' Detect operating system Dim os As String = GetSystemProperty("os.name", "").ToLowerCase Log(os) If os.Contains("win") Then ' Set variable here Else If os.Contains("mac") Then ' Set variable here Else 'Linux ' Set variable here End If Get list of available drives Code: Copy For Each drive As String In ListRoots Log(drive) Next Sub ListRoots As List Dim jo As JavaObject Dim o() As Object = jo.InitializeStatic("java.io.File").RunMethod("listRoots", Null) Return o End Sub It would be convenient to access drives and have it opened in finder on Mac and Explorer on PC, and how to browse contents on Linux and Ubuntu? Last edited: Nov 25, 2016
How to open any of the drives to browse contents on a Mac? I've heard that Finder is equal to Explorer on a PC but how is this done? What I try to do is to add a list of available units that will be shown in a trayicon, which should work on both PC and Mac. For example the following drive info should be accessible from both PC and Mac: * Available partition * Drive name * Available space * Total space When an item in the list is clicked, the contents should be shown in finder on Mac and Explorer on PC. Also how does this work on Linux and perhaps if Java works on Ubuntu and other platforms? Btw the equality to Taskbar in Windows should be the 'Dock' on Mac. I assume it can be rightclicked and selected just as in the trayicon on PC!!! What I do is to check OS and set a global flag: Code: Copy ' Detect operating system Dim os As String = GetSystemProperty("os.name", "").ToLowerCase Log(os) If os.Contains("win") Then ' Set variable here Else If os.Contains("mac") Then ' Set variable here Else 'Linux ' Set variable here End If Get list of available drives Code: Copy For Each drive As String In ListRoots Log(drive) Next Sub ListRoots As List Dim jo As JavaObject Dim o() As Object = jo.InitializeStatic("java.io.File").RunMethod("listRoots", Null) Return o End Sub It would be convenient to access drives and have it opened in finder on Mac and Explorer on PC, and how to browse contents on Linux and Ubuntu?
Erel B4X founder Staff member Licensed User Longtime User Nov 27, 2016 #2 You can use this code on Mac to open finder: https://www.b4x.com/android/forum/t...ill-not-open-file-location.72671/#post-462918 I haven't tested it on Linux. Upvote 0
You can use this code on Mac to open finder: https://www.b4x.com/android/forum/t...ill-not-open-file-location.72671/#post-462918 I haven't tested it on Linux.