Friday, February 24, 2012

Get path of Special folders

Run the sub below for more MacScript examples


Sub MoreSpecialFoldersExample()
' Call AppleScript to get the Special Folders
Dim SpecialFolders As String

SpecialFolders = _
    "Application Folder : " & MacScript("return (path to applications folder) as string") & vbNewLine & _
    "Desktop Folder : " & MacScript("return (path to desktop folder) as string") & vbNewLine & _
    "Documents Folder : " & MacScript("return (path to documents folder) as string") & vbNewLine & _
    "Music Folder : " & MacScript("return (path to music folder) as string") & vbNewLine & _
    "Pictures Folder : " & MacScript("return (path to pictures folder) as string") & vbNewLine & _
    "Movie Folder : " & MacScript("return (path to movies folder) as string")

    MsgBox SpecialFolders
End Sub

Note: There are other path options that also not working on a Mac, for example StartupPath.

No comments:

Post a Comment