自动化批处理脚本 - 在 Photoshop 中将文件名转换为文本
如何在 Photoshop 中将一堆文件的每个文件名转换为文本图层(并保存)?
文件夹 1:数百个文件
文件夹 2:几乎相同的文件,但每个文件的文件名都贴在其图像上
这是一个破解的片段。我似乎无法解决的错误是如何将 activeDocument 设置为当前打开的文档。 http://pastebin.com/b0fqG9v4
How do you convert each filename of a bunch of files, each to a text layer (and save) in Photoshop?
Folder 1: Hundereds of files
Folder 2: Nearly the same files, but each with its filename plastered onto its image
Here is a hacked up snippet. The error that I can't seem to get by is how to set the activeDocument to the currently open one. http://pastebin.com/b0fqG9v4
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尚未被标记为已回答,因此这里有一个 CS 的 javascript 示例(也应该适用于更高版本),以防有人关心这样的事情。这将打开源文件夹中的每个图像文件并添加新的文本图层。将文件名设置为文本图层的内容,然后将新文件保存到输出位置。
它并没有真正尝试将文本适合图像,这当然是可能的,但很复杂。
如果您将颜色管理设置为在打开带有与工作色彩空间不匹配的嵌入配置文件的文件时发出警告,您将看到配置文件不匹配对话框。您可以设置您的首选项自动处理这种情况。
Hasn't been marked as answered so here's a javascript example for CS (and should work on later versions too) in case anyone cares for such a thing. This opens each image file in a source folder and adds a new text layer. The name of the file is set as the content of the text layer, then the new file is saved to an output location.
It does not really try to fit the text on the image, that's certainly possible but complicated.
If you have color management set to warn you when opening a file with an embedded profile that doesn't match the working color space you will get a profile mismatch dialog. You could set your preferences handle such a situation automatically.
显然,Photoshop 可以通过 Javascript 编写脚本,因此使用虚拟文件作为模型,您应该能够执行您需要的操作。以下是一些有关 Photoshop 脚本的资源:
Apparently, Photoshop is scriptable via Javascript, so with a dummy file as a model, you should be able to do what you need. Here are some resources about Photoshop scripting :