यह मेरे लिए काम करता है, मूल दस्तावेज के रूप में एक ही नाम के साथ पाठ बचाता है, लेकिन विस्तार txt
साथ:
function saveTxt(txt)
{
var Name = app.activeDocument.name.replace(/\.[^\.]+$/, '');
var Ext = decodeURI(app.activeDocument.name).replace(/^.*\./,'');
if (Ext.toLowerCase() != 'psd')
return;
var Path = app.activeDocument.path;
var saveFile = File(Path + "/" + Name +".txt");
if(saveFile.exists)
saveFile.remove();
saveFile.encoding = "UTF8";
saveFile.open("e", "TEXT", "????");
saveFile.writeln(txt);
saveFile.close();
}
मैं नहीं जानता कि यह कैसे काम करता, फ़ोटोशॉप पटकथा एक बड़ी गड़बड़ है, मैं बस रखा कुछ स्क्रिप्ट्स को मिलाकर मिला जो मैंने पाया जब तक कि यह काम नहीं करता।
function savePng()
{
var Name = app.activeDocument.name.replace(/\.[^\.]+$/, '');
var Ext = decodeURI(app.activeDocument.name).replace(/^.*\./,'');
if (Ext.toLowerCase() != 'psd')
return;
var Path = app.activeDocument.path;
var saveFile = File(Path + "/" + Name +".png");
if(saveFile.exists)
saveFile.remove();
var o = new ExportOptionsSaveForWeb();
o.format = SaveDocumentType.PNG;
o.PNG8 = false;
o.transparency = true;
o.interlaced = false;
o.includeProfile = false;
activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, o);
}
स्रोत
2013-09-24 17:30:01
धन्यवाद! मैं में फ़ाइल मिली/अनुप्रयोग/उपयोगिताएँ/एडोब उपयोगिताएँ-CS5.localized/ExtendScript टूलकिट CS5/एसडीके – torus
स्रोत कोड दस्तावेजों के हजारों के लायक है। –