因此,我被指示为我的工作编写一个脚本,目标是我们能够选择计算机上的文件夹并将它们备份到我们其中一台服务器上的文件夹中。到目前为止,我给出了安装服务器的脚本,将用户名作为输入,并在服务器上创建一个名为该用户名的文件夹。下一步是将选定的文件夹复制到服务器上的新文件夹中,这就是我遇到减速带的地方(我有一行代码可以让用户选择多个文件夹,但我无法让它们复制到该新文件夹)
这是我到目前为止的代码。
display dialog "Please enter your augnet username" default answer "username"
set username to (text returned of result)
mount volume "smb://orgs.augsburg.edu"
delay 3
tell application "Finder"
set folder backup to make new folder at folder "ORGS:Information Technology:www:kb_images:Migration Testing:" with properties {name:username}
end tell
choose folder with prompt "Please select what you would like to transfer" with multiple selections allowed
set theSelection to result
tell application "Finder" to duplicate theSelection to folder backup