使用Applescript打开用户的库文件夹

使用Applescript打开用户的库文件夹,applescript,Applescript,我想打开一个默认为应用程序设置文件夹的文件夹: /Users/XXX/Library/Application Support/Tunnelblick/Configurations 我不想对“XXX”进行硬编码 /library文件夹: 主文件夹: 我不确定如何获取~/Library文件夹及其子文件夹。已解决: set theDefault to (path to home folder as text) & "Library:Application Support:Tunnelblic

我想打开一个默认为应用程序设置文件夹的文件夹:

/Users/XXX/Library/Application Support/Tunnelblick/Configurations
我不想对“XXX”进行硬编码

/library文件夹:

主文件夹:

我不确定如何获取~/Library文件夹及其子文件夹。

已解决:

set theDefault to (path to home folder as text) & "Library:Application Support:Tunnelblick:Configurations" as alias

set theDestination to (choose folder with prompt "Open destination folder" default location theDefault)
已解决:

set theDefault to (path to home folder as text) & "Library:Application Support:Tunnelblick:Configurations" as alias

set theDestination to (choose folder with prompt "Open destination folder" default location theDefault)

图书馆的路径包括:

POSIX path of (path to library folder from user domain)
=~/库/

POSIX path of (path to library folder from local domain)
POSIX path of (path to library folder from system domain)
=/库/

POSIX path of (path to library folder from system domain)

=/System/Library/

到库的路径是:

POSIX path of (path to library folder from user domain)
POSIX path of (path to library folder from system domain)
=~/库/

POSIX path of (path to library folder from local domain)
POSIX path of (path to library folder from system domain)
=/库/

POSIX path of (path to library folder from system domain)
=/System/Library/

系统还了解应用程序支持文件夹:

POSIX path of (path to library folder from system domain)
set aFolderPath to ((path to application support folder from user domain) as text) & "Tunnelblick:Configurations:"
try
    set destinationPath to aFolderPath as alias
on error
    beep
    log aFolderPath & " missing"
    return
end try
set theDestination to (choose folder with prompt "Open destination folder" default location destinationPath)
请参见标准添加,路径至

系统还了解应用程序支持文件夹:

set aFolderPath to ((path to application support folder from user domain) as text) & "Tunnelblick:Configurations:"
try
    set destinationPath to aFolderPath as alias
on error
    beep
    log aFolderPath & " missing"
    return
end try
set theDestination to (choose folder with prompt "Open destination folder" default location destinationPath)
请参见标准添加,路径至

用户域=~/Library。本地域和系统域之间有什么区别?用户域=~/Library。本地域和系统域之间有什么区别?