Photoshop脚本忽略.ds_store [英] Photoshop script to ignore .ds_store

查看:196
本文介绍了Photoshop脚本忽略.ds_store的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的JavaScript技能大约为0,我只知道一些html和CSS. 我希望有人仍然可以帮助我解决这个问题.

my skills with javascript are about 0, I only know some html and css. I hope someone can still help me solving this.

我在photoshop中使用脚本来抓取图片,进行一些魔术处理并将其作为图层放置到psd文件中.您可能会猜想我还没有编写脚本,但是它是工作所需的.

I am working in photoshop with a script that grabs pictures, does some magic and places them into a psd file as layers. As you might guess i haven't written the script but its needed for work.

问题是,它捕获了.ds_store文件以及图像,从而导致错误警告.

The problem is, its grabbing the .ds_store files as well as the images, which results in an error warning.

这是定义来源的行:

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?

最佳,

卢卡斯

推荐答案

您可以忽略.dotfile,并通过使用以下代码段使文件扩展名为3个字符.

you can ignore .dotfile and get files have 3-characters file extension by using following a snippet.

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

谢谢

mg

这篇关于Photoshop脚本忽略.ds_store的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆