B4J Question How to open Applications folder on Mac?

ThRuST

Well-Known Member
Licensed User
Longtime User
I've tested to open Downloads folder on Mac which works by using this

B4X:
Dim folder As String = GetSystemProperty("user.home", "") & "/Downloads"
    fx.Msgbox(MainForm, folder, "")
    
    Dim shl As Shell
    shl.InitializeDoNotHandleQuotes("shl", "Open", Array As String ("" & folder))
    shl.WorkingDirectory = "/"
    shl.Run(400)

However when I try to open Applications folder it does not work. Any clues?

B4X:
Try
    
        Dim folder As String = GetSystemProperty("user.home", "") & "/Applications"
        fx.Msgbox(MainForm, folder, "")
    
        Dim shl As Shell
        shl.InitializeDoNotHandleQuotes("shl", "Open", Array As String (folder))
        shl.WorkingDirectory = "/"
        shl.Run(400)
        
    Catch
        fx.Msgbox(MainForm, LastException.Message, "")
    End Try
 

ThRuST

Well-Known Member
Licensed User
Longtime User
ok I solved this myself here's the solution

B4X:
Try
    
        Dim folder As String = "/Applications"
        fx.Msgbox(MainForm, folder, "")
    
        Dim shl As Shell
        shl.InitializeDoNotHandleQuotes("shl", "Open", Array As String (folder))
        shl.WorkingDirectory = "/"
        shl.Run(400)
        
    Catch
        fx.Msgbox(MainForm, LastException.Message, "")
    End Try
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…