【发布时间】:2017-02-20 14:51:50
【问题描述】:
这里还是菜鸟/新手
所以我正在尝试重命名文件夹中的文件
set newfoldername to DT & "-" & JobName & " - " & Wedding --Adds Date, Couples name and event type to make directory name
更多代码在这里
set destFolder to loc & newfoldername & ":Final Delivery:DVD:"
tell application "Finder"
duplicate file sourcedvdtemp to folder destFolder
set the name of file "DVD_template.dspproj" to newfoldername
end tell
但我只是得到一个错误
"error "Finder 出现错误:无法将文件 \"DVD_template.dspproj\" 设置为 \"newfoldername.dspproj\"。" 来自文件 "DVD_template.dspproj" 的编号 -10006"
我尝试了各种方法,上面设置了带有和不带有扩展名“newfoldername”,并使用用户输入的名称创建了一个文件夹
我只是愚蠢还是我完全错过了什么。
编辑
tell application "Finder" to set frontmost to true
set DT to text returned of (display dialog "Please enter the wedding date" default answer "YYYY/MM/DD") --Asks for date of wedding
set JobName to text returned of (display dialog "Please enter the couples name" default answer "Bride & Groom + Surname") --Asks for couples name
set Wedding to text returned of (display dialog "Please enter the type of day" default answer "Wedding") --Asks for type of day, Wedding, Party, etc
--Creates directory with info from above
set loc to (choose folder "Please choose where you would like to save the files") as text --Loc = Location of where directory will be placed
set newfoldername to DT & "-" & JobName & " - " & Wedding --Adds Date, Couples name and event type to make directory name
set folderStructure to "/{Audio/{Music,RAW\\ Audio\\ Cards},Documents,Exports,FCPX\\ Library,Film\\ Poster,Final\\ Delivery/{DVD,USB,WEB},Images/{Graphics,Stills},RAW\\ Cards/{C100-1,C100-2,7D,100D},XML}"
do shell script "mkdir -p " & quoted form of POSIX path of (loc & newfoldername) & folderStructure
set sourcedvdtemp to (path to movies folder as text) & "## - WeddingTemplate - ##:DVD_template.dspproj" --Gets file DVD_template
set sourceusbtemp to (path to movies folder as text) & "## - WeddingTemplate - ##:USB_template.zip" --Gets file USB_template
set sourcewebtemp to (path to movies folder as text) & "## - WeddingTemplate - ##:WEB_template.zip" --Gets file WEB_template
set sourcefcpxtemp to (path to movies folder as text) & "## - WeddingTemplate - ##:FCPX_template.fcpbundle" --Gets file FCPX_template
set sourcefilmpostemp to (path to movies folder as text) & "## - WeddingTemplate - ##:FILM_POSTER_Template.psd" --Gets file FILM_POSTER_template
set destFolder to loc & newfoldername & ":Final Delivery:DVD:"
tell application "Finder"
duplicate file sourcedvdtemp to folder destFolder
set the name of file "DVD_template.dspproj" to newfoldername
end tell
set destFolder to loc & newfoldername & ":FCPX Library:"
tell application "Finder"
duplicate file sourcefcpxtemp to folder destFolder
set the name of file "FCPX_template.fcpbundle" to newfoldername
end tell
set destFolder to loc & newfoldername & ":Film Poster:"
tell application "Finder"
duplicate file sourcefilmpostemp to folder destFolder
set the name of file "FILM_POSTER_Template.psd" to newfoldername
end tell
【问题讨论】:
标签: applescript