如何使用applescript通过从剪贴板粘贴来命名文件夹

时间:2012-10-24 20:56:57

标签: applescript adobe-indesign save-as

我从事平面设计工作,想要自动创建一个自动的脚本:

  1. 打开指定的文档模板。
  2. 创建一个新项目文件夹。
  3. 使用剪贴板中的文本命名该文件夹。
  4. 将新打开的文档保存到新创建的文件夹中,并使用剪贴板中的相同文本命名该文档。
  5. 我对Applescript很陌生,所以打字非常慢,并使用小词,以便我能理解。

    到目前为止,这是我用代码的方式提出的:

    tell application "Adobe InDesign CS5"
    set myDocument to open "cm:Graphic_Design:Design Studio Templates:Brochure_042012_001:Brochure_042012_001.indt"
    end tell
    tell application "Finder"
    make new folder at folder "Work" of folder "Graphic_Design" of disk "cm" with properties {name:"untitled folder"}
    set name of folder "untitled folder" of folder "Work" of folder "Graphic_Design" of disk "cm" to pbpaste
    end tell
    

1 个答案:

答案 0 :(得分:0)

尝试:

tell application "Finder" to set newFolder to make new folder at "cm:Graphic_Design:Work" with properties {name:(the clipboard as text)}
tell application "Adobe InDesign CS5"
    tell active document to save saving in (newFolder as text)
    end tell