简体   繁体   English

Photoshop脚本忽略.ds_store

[英]Photoshop script to ignore .ds_store

my skills with javascript are about 0, I only know some html and css. 我的JavaScript技能大约为0,我只知道一些html和CSS。 I hope someone can still help me solving this. 我希望有人仍然可以帮助我解决这个问题。

I am working in photoshop with a script that grabs pictures, does some magic and places them into a psd file as layers. 我在photoshop中使用脚本来抓取图片,进行一些魔术处理并将其作为图层放置到psd文件中。 As you might guess i haven't written the script but its needed for work. 您可能会猜想我还没有编写脚本,但是它是工作所需的。

The problem is, its grabbing the .ds_store files as well as the images, which results in an error warning. 问题在于,它抓取了.ds_store文件和图像,从而导致错误警告。

this is the line that defines the source: 这是定义源的行:

var taschenQuelle = Folder.selectDialog();
alert("Click OK to start processing.", "TEASER 2014");
var listeAllerTaschen = taschenQuelle.getFiles();

How can I specify that its ignoring the system files? 如何指定其忽略系统文件?

Best, 最好,

Lukas 卢卡斯

you can ignore .dotfile and get files have 3-characters file extension by using following a snippet. 您可以忽略.dotfile并通过使用以下代码段使文件扩展名为3个字符。

//@target "Photoshop"
var f = Folder.selectDialog("select");
alert(f.getFiles(function (file) {return /^[^.]+\.[^.]{3}$/i.test(file.name)}));

thank you 谢谢

mg 毫克

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM