【问题标题】:Create folder move files - Applescript创建文件夹移动文件 - Applescript
【发布时间】:2015-06-03 15:11:30
【问题描述】:

我正在寻找:

  1. 从桌面移动文件夹

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

    1b。将文件夹从桌面放到 使用属性 {name:"Emails"} 在 newfo 处创建新文件夹

脚本:

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

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

【问题讨论】:

    标签: file makefile applescript directory


    【解决方案1】:

    这是你想要达到的目标吗?

        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
    

    【讨论】:

    • 是的!差不多..希望在根目录中有“Screenshots”文件夹..所以不要将它添加到我创建的文件夹中,而是“Screenshots”文件夹中的内容。 @craigsmith
    • 我想知道你为什么使用主目录。很抱歉将 Screenshots 术语留在其中。请看看编辑后的脚本是否更接近。
    • 不客气。您介意将此标记为答案吗?
    猜你喜欢
    • 2013-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-19
    • 1970-01-01
    • 2021-03-14
    相关资源
    最近更新 更多