2012-10-24 127 views
1

我在图形设计工作,粘贴命名文件夹,并希望创建的InDesign的脚本,自动将:如何使用AppleScript的从剪贴板

  1. 打开指定的文档模板。
  2. 创建一个新的项目文件夹。
  3. 将该文件夹命名为剪贴板中的文本。
  4. 将新打开的文档保存到新创建的文件夹中,并使用剪贴板中的相同文本命名该文档。

我对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 
+0

pbpaste是一个shell命令。如果你想运行,你会'做shell脚本'pbpaste''。但是随着adayzdone在他的代码中显示,applescript可以直接得到剪贴板,而不需要shell命令,就像'将folderName设置为剪贴板'。 – regulus6633

回答

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