Applescript/Photoshop:使用图像创建新图层

发布于 2024-11-27 22:04:41 字数 203 浏览 2 评论 0原文

如何在文档中创建一个新图层,并在该图层中包含图像?我正在使用 Pohotoshop CS5 和 AppleScript。 我知道如何制作这样的新图层:

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

只是不知道如何将图像放入其中。 谢谢。

How can I create a new layer in a document with an image in that layer? I am using Pohotoshop CS5 and AppleScript.
I know how to make a new layer like this:

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

Just don't know how to put an image in it.
Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

零度° 2024-12-04 22:04:41

如果您需要直接从文件复制它,那就更复杂了,并且需要打开另一个应用程序(预览版)并从预览版复制它。这可能会有所帮助:

    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

基本上就是这样!希望这能在某种程度上有所帮助。

If you need it copied straight from a file, that's more complicated, and requires to open up a different app (Preview) and copy it from Preview. This may help:

    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

That asks for an image, opens Preview, selects all of the image, copies it, and then quits.

To then paste it into 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

And that's basically it! Hope that helped in some way.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文