2012-10-24 45 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