0
我在設計機構工作,正在嘗試創建一個創建文件夾結構的applescript,然後將文件複製到它創建的指定文件夾中。創建文件夾結構並將文件複製到特定文件夾中
我是applescript的新手,拖網互聯網之後,我設法創建了創建文件夾的位。這使我可以創建具有特定工作號碼的文件夾,然後選擇保存它的位置。這一切運作良好。我現在要做的就是將幾個文檔複製到它創建的文件夾中。
這是我到目前爲止有:
tell application "Finder"
activate
set jobNum to text returned of (display dialog "Enter a job number:" default answer "")
set jobName to text returned of (display dialog "Enter a job name:" default answer "")
set folderpath to POSIX path of (choose folder with prompt "Select client folder")
do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum & "_" & jobName) & "/" & quoted form of (jobNum & "_Reference") & "/" & quoted form of (jobNum & "_Briefs")
do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum & "_" & jobName) & "/" & quoted form of (jobNum & "_Reference") & "/" & quoted form of (jobNum & "_Copy")
do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum & "_" & jobName) & "/" & quoted form of (jobNum & "_Reference") & "/" & quoted form of (jobNum & "_Supplied")
do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum & "_" & jobName) & "/" & quoted form of (jobNum & "_Assets")
do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum & "_" & jobName) & "/" & quoted form of (jobNum & "_Old")
do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum & "_" & jobName) & "/" & quoted form of (jobNum & "_Final_Artwork")
do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum & "_" & jobName) & "/" & quoted form of (jobNum & "_Assets") & "/" & quoted form of (jobNum & "_Purchased_Images")
do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum & "_" & jobName) & "/" & quoted form of (jobNum & "_Assets") & "/" & quoted form of (jobNum & "_Non_Purchased_Images")
do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum & "_" & jobName) & "/" & quoted form of (jobNum & "_In_Situ") & "/" & quoted form of (jobNum & "_JPG's")
do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum & "_" & jobName) & "/" & quoted form of (jobNum & "_In_Situ") & "/" & quoted form of (jobNum & "_PSD's")
do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum & "_" & jobName) & "/" & quoted form of (jobNum & "_Artwork_&_Design") & "/" & quoted form of (jobNum & "_Id")
do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum & "_" & jobName) & "/" & quoted form of (jobNum & "_Artwork_&_Design") & "/" & quoted form of (jobNum & "_Ai")
do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum & "_" & jobName) & "/" & quoted form of (jobNum & "_Artwork_&_Design") & "/" & quoted form of (jobNum & "_PS") & "/" & quoted form of (jobNum & "_PSDs")
do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum & "_" & jobName) & "/" & quoted form of (jobNum & "_Artwork_&_Design") & "/" & quoted form of (jobNum & "_PS") & "/" & quoted form of (jobNum & "_JPGs")
do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum & "_" & jobName) & "/" & quoted form of (jobNum & "_Artwork_&_Design") & "/" & quoted form of (jobNum & "_Presentation_Boards")
do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum & "_" & jobName) & "/" & quoted form of (jobNum & "_C4D") & "/" & quoted form of (jobNum & "_Assets")
do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum & "_" & jobName) & "/" & quoted form of (jobNum & "_C4D") & "/" & quoted form of (jobNum & "_Renders")
do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum & "_" & jobName) & "/" & quoted form of (jobNum & "_C4D") & "/" & quoted form of (jobNum & "_Visuals")
do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum & "_" & jobName) & "/" & quoted form of (jobNum & "_Creative") & "/" & quoted form of (jobNum & "_Mac_Scamps")
do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum & "_" & jobName) & "/" & quoted form of (jobNum & "_Creative") & "/" & quoted form of (jobNum & "_Scamps")
do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (jobNum & "_" & jobName) & "/" & quoted form of (jobNum & "_For_Client")
end tell
例如我想將InDesign文件複製到「演示文稿板」文件夾中,並將pdf複製到參考文件中,然後在AppleScript完成後打開。
任何幫助將不勝感激。 謝謝
不要使用做一個告訴應用程序塊中的shell腳本,除非你的目標當前的應用程序不變。它違反了腳本添加安全性,有時會引發錯誤。 –
可能的重複[移動與蘋果的finder中的文件](http://stackoverflow.com/questions/14058061/move-a-file-in-finder-with-applescript) –