Photoshop script to ignore .ds_store

送分小仙女□ 提交于 2019-12-12 05:05:28

问题


my skills with javascript are about 0, I only know some html and 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. 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.

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


回答1:


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)}));

thank you

mg



来源:https://stackoverflow.com/questions/40059681/photoshop-script-to-ignore-ds-store

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!