Applescript Posix文件和路径

Mic*_*ell 1 applescript templates posix duplicates

我正在尝试设置脚本以将模板文件复制到新创建的文件夹.该文件是从template_name创建的变量.不幸的是我是一个posix新手,似乎无法获得将模板文件复制到新文件夹的脚本.

返回的错误是"无法设置"/应用程序"Finder"的"Volumes/Media/NewFolder"到应用程序"Finder"的文件"Volumes/Media/+ A3Temp.ptx"

set temp_name to client_code & " " & brand_name & " " & job_name & " " & job_number & " " & creation_date
set media_folder to "/Volumes/Media/"
set new_folder to media_folder & temp_name
set template_name to ("+" & suite & "Temp.ptx") as string
set session_name to (client_code & " " & brand_name & " " & job_name & " " &     creation_date & ".ptx")
set template to (media_folder & template_name)



tell application "Finder"
    duplicate POSIX file template to POSIX file new_folder
end tell
Run Code Online (Sandbox Code Playgroud)

我知道这些行的错误

tell application "Finder"
    duplicate POSIX file template to POSIX file new_folder
end tell
Run Code Online (Sandbox Code Playgroud)

但我不知道如何补救它.任何人都可以帮忙!?

Lri*_*Lri 5

运行此脚本时出现类似错误:

set f to "/usr/share/dict/connectives"
set d to "/private/tmp/"
tell application "Finder"
    duplicate POSIX file f to POSIX file d
end tell
Run Code Online (Sandbox Code Playgroud)

Finder收到错误:无法将POSIX文件"/ private/tmp /"设置为POSIX文件"/ usr/share/dict/connectives".

其中任何一个都有效:

set f to POSIX file "/usr/share/dict/connectives"
set d to POSIX file "/private/tmp/"
tell application "Finder"
    duplicate f to d
end tell
Run Code Online (Sandbox Code Playgroud)
tell application "Finder"
    duplicate POSIX file "/usr/share/dict/connectives" to POSIX file "/private/tmp/"
end tell
Run Code Online (Sandbox Code Playgroud)