2011-08-02 30 views
4

如何使用該圖層中的圖像在文檔中創建新圖層?我正在使用Pohotoshop CS5和AppleScript。 我知道如何使一個新層是這樣的:Applescript/Photoshop:使用圖像創建新圖層

set newLayer to make art layer with properties {name:"LayerA"} 

只是不知道如何把圖像中它。 謝謝。

回答

1

如果您需要直接從文件中複製它,那會更復雜,並且需要打開其他應用程序(預覽)並從預覽中複製它。這可能有所幫助:

set this_picture to choose file 
tell application "Preview" 
    activate 
    open this_picture 
end tell 
tell application "System Events" 
    tell process "Preview" 
     keystroke "a" using command down 
     keystroke "c" using command down 
    end tell 
end tell 
tell application "Preview" to quit 

要求圖像,打開預覽,選擇所有圖像,複製它,然後退出。

爲了然後將其粘貼到Photoshop:

tell application "Adobe Photoshop CS5" 
     activate 
    end tell 
    tell application "System Events" 
     tell process "Adobe Photoshop CS5" 
      set newLayer to make art layer with properties {name:"LayerA"} 
      keystroke "v" using command down 
     end tell 
    end tell 

而這基本上它!希望在某種程度上有所幫助。

+0

非常感謝!有沒有辦法可以在Photoshop中打開的文檔之間複製圖層?再次感謝。 – sumderungHAY