Have you tried conditional compiling.
[VBA]Sub test()
Dim returnVal As String

#If Mac Then
returnVal = MacScript("try" & vbLf & "choose folder" & vbLf & "end try")
If returnVal = Chr(0) Then returnVal = "False"
#Else
Rem code for Windows
#End If

If returnVal = "False" Then
MsgBox "cancel pressed"
Else
MsgBox "folder chosen: " & vbCr & vbCr & returnVal
End If
End Sub[/VBA]