创建文件夹移动文件 - Applescript

时间:2015-06-03 15:11:30

标签: file makefile applescript directory

我期待:

  1. 从桌面移动文件夹

    1a上。创建一个文件夹,其中将jobName设置为返回的文本(显示对话框“请输入作业名称:”默认答案“Job_Name”)

    1b中。从在newfo下新建文件夹中删除桌面文件夹,其中包含属性{name:“Emails”}

  2. 脚本:

    set jobName to text returned of (display dialog "Please enter Job Name:" default     answer "Job_Name")
    set loc to choose folder "Choose Parent Folder Location"
    
    tell application "Finder"
    set home_path to home as text
    set source to alias (home_path & "Desktop:WorkingFolder")
    set newfo to make new folder at loc with properties {name:jobName}
        make new folder at newfo with properties {name:"Emails"}
    
    set destination to home_path & jobName
    
    tell application "Finder" to duplicate source to destination with replacing
    end tell
    

    任何帮助将不胜感激。谢谢,

1 个答案:

答案 0 :(得分:0)

这是你想要实现的目标吗?

    set jobName to text returned of (display dialog "Please enter Job Name:" default answer "Job_Name")
set loc to choose folder with prompt "Choose Parent Folder Location"

tell application "Finder"
    set source to alias ((path to desktop as text) & "WorkingFolder:")
    set newfo to make new folder at loc with properties {name:jobName}
    make new folder at newfo with properties {name:"Emails"}
    set destination to make new folder at (path to home folder) with properties {name:jobName}
    tell application "Finder" to duplicate source to destination with replacing
end tell