'set theFiles to (choose file of type ' & ' ' & _ MyScript = 'set applescript's text item delimiters to '','' ' & vbNewLine & _ 'Set up the Apple Script to look for text files MyPath = MacScript('return (path to documents folder) as String') 'Uses AppleScript to select files on a Macĭim MyPath As String, MyScript As String, MyFiles As String, MySplit As Variant The code that calls the function and displays a message box with all the files: Sub GetTextFilesOnMac()įor ii = LBound(vFileName) To UBound(vFileName)Īnd the function that does the Apple Script work: Function Select_File_Or_Files_Mac() As Variant You would simply be able to modify the Apple Script to return other file types and select directories, I'll leave that to you. The following code allows the user to select text files which is returned as an array from the function. I believe you have to use Apple Script in order to do this a bit better on the Mac.