Photoshop JSX -- 如何将任意文本复制到剪贴板?
现在,我使用提示命令作为解决方法,从 Photoshop 中的 JSX 脚本中复制任意文本。
prompt("to copy",(horizontalcenter.toString()) + ", " + verticalcenter.toString());
这给了我我想要的信息。 “复制”只是给出了标题,那么我要从Photoshop中复制出来的信息就在已经选中的提示框中。因此,我所要做的就是点击 Control C,转到需要此信息的 Notepad++,然后点击 Control V。
它可以工作,但可能会更快。必须有一种方法可以将这些信息从 Photoshop 直接复制到剪贴板,不是吗?
Right now I am using the prompt command as a workaround to copy arbitrary text out of my JSX script in Photoshop.
prompt("to copy",(horizontalcenter.toString()) + ", " + verticalcenter.toString());
And that is giving me the information that I want. The "to copy" just gives the title, then the information I want to copy out of Photoshop is in the prompt box already selected. So all I have to do is hit control C, go to Notepad++ where I need this information, and hit control V.
It works, but it could be faster. There has to be a way to copy this information out of Photoshop straight to the clipboard, no?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Photoshop 13.1(Photoshop CS6 的最新 Creative Cloud 版本)现在有一个挂钩,允许您直接执行此操作。这是一个示例函数:
请注意,这在 13.1 之前的 Photoshop 版本中不起作用
Photoshop 13.1 (the latest Creative Cloud release of Photoshop CS6) now has a hook allowing you to do this directly. Here's a sample function:
Please note this won't work in versions of Photoshop prior to 13.1
在 Photoshop 脚本论坛上找到了答案。
http ://ps-scripts.com/bb/viewtopic.php?f=9&t=3097&p=15324&hilit=clipboard&sid=1b1cc023023b9f91ab46e30e48e2ab53#p15324
它将您要复制的文本放入临时文本文件,然后从该文本文件复制它。我什至不知道你可以将文本放入文本文件中。显然 Photoshop 中的 javascript 功能比我想象的要强大得多!
Found the answer on a Photoshop scripting forum.
http://ps-scripts.com/bb/viewtopic.php?f=9&t=3097&p=15324&hilit=clipboard&sid=1b1cc023023b9f91ab46e30e48e2ab53#p15324
It's placing the text you want to copy in a temp text file, then copying it from that text file. I didn't even know you could place text into a text file. Apparently the javascript capabilities in Photoshop are much more powerful than I realized!