Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
// Example of Reading all Files in a Folder
// and creating Textlayers from its filenames
// enable double clicking from the Macintosh Finder or the Windows Explorer
#target photoshop
// in case we double clicked the file
app.bringToFront();
// debug level: 0-2 (0:disable, 1:break on error, 2:break at beginning)
// $.level = 0;
// debugger; // launch debugger on next line
var strtRulerUnits = app.preferences.rulerUnits;
var strtTypeUnits = app.preferences.typeUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.POINTS;
var docRef = app.documents.add(1280, 720, 72);
var selRef = app.activeDocument.all;
var textColor = new SolidColor();
textColor.rgb.red = 255;
textColor.rgb.green = 0;
textColor.rgb.blue = 0;
// suppress all dialogs
app.displayDialogs = DialogModes.NO;
try {
// Ask user for input folder
var inputFolder = Folder.selectDialog("select Folder");
var fileList = inputFolder.getFiles("*.*");
for (var i = 0; i < fileList.length; i++) {
// split example
var explodedName = fileList[i].name.split(".");
var newText = explodedName[0] +String.fromCharCode(13)+"from"+String.fromCharCode(13)+explodedName[1];
//var newText = fileList[i].name;
var newTextLayer = docRef.artLayers.add();
newTextLayer.kind = LayerKind.TEXT;
newTextLayer.textItem.contents = newText;
newTextLayer.textItem.position = Array(240, 10+i*36);
newTextLayer.textItem.size = 12;
newTextLayer.textItem.color = textColor;
}
}
catch (exception) {
alert(exception);
}
finally {
app.displayDialogs = startDisplayDialogs;
}
app.preferences.rulerUnits = strtRulerUnits;
app.preferences.typeUnits = strtTypeUnits;
docRef = null;
textColor = null;
newTextLayer = null;
var bgColor = new SolidColor();
bgColor.rgb.red = 140;
bgColor.rgb.green = 125;
bgColor.rgb.blue = 120;
backgroundColor = bgColor;
var docRef = app.documents.add(1280, 720, 72, DocumentFill.BACKGROUNDCOLOR);
newTextLayer.textItem.contents = newText.replace ("%20", " ");
// Example of Reading all Files in a Folder
// and creating Textlayers from its filenames
// enable double clicking from the Macintosh Finder or the Windows Explorer
#target photoshop
// in case we double clicked the file
app.bringToFront();
// debug level: 0-2 (0:disable, 1:break on error, 2:break at beginning)
// $.level = 0;
// debugger; // launch debugger on next line
var strtRulerUnits = app.preferences.rulerUnits;
var strtTypeUnits = app.preferences.typeUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.POINTS;
var bgColor = new SolidColor();
bgColor.rgb.red = 140;
bgColor.rgb.green = 125;
bgColor.rgb.blue = 120;
backgroundColor = bgColor;
var docRef = app.documents.add(1280, 720, 72, DocumentFill.BACKGROUNDCOLOR);
var selRef = app.activeDocument.all;
var textColor = new SolidColor();
textColor.rgb.red = 0;
textColor.rgb.green = 140
textColor.rgb.blue = 200;
// suppress all dialogs
app.displayDialogs = DialogModes.NO;
try {
// Ask user for input folder
var inputFolder = Folder.selectDialog("select Folder");
var fileList = inputFolder.getFiles("*from*");
for (var i = 0; i < fileList.length; i++) {
// split example
var explodedName = fileList[i].name.split("from");
var newText = explodedName[0] +String.fromCharCode(13)+"from"+String.fromCharCode(13)+explodedName[1];
//var newText = fileList[i].name;
var fontName = "Philosopher";
var newTextLayer = docRef.artLayers.add();
newTextLayer.kind = LayerKind.TEXT;
newTextLayer.textItem.contents = newText.replace ("%20", " ");
newTextLayer.textItem.position = Array(340, 50+i*36);
newTextLayer.textItem.size = 36;
newTextLayer.textItem.color = textColor;
newTextLayer.textItem.font = fontName;
saveFile = new File(newText+".jpg");
saveOptions = new JPEGSaveOptions();
saveOptions.embedColorProfile = true;
saveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
saveOptions.matte = MatteType.NONE;
saveOptions.quality = 9;
activeDocument.saveAs(saveFile, saveOptions, true,Extension.LOWERCASE);
activeDocument.close(SaveOptions.DONOTSAVECHANGES) ;
}
}
catch (exception) {
alert(exception);
}
finally {
app.displayDialogs = startDisplayDialogs;
}
app.preferences.rulerUnits = strtRulerUnits;
app.preferences.typeUnits = strtTypeUnits;
docRef = null;
textColor = null;
newTextLayer = null;
var docRef = app.documents.add(1280, 720, 72,);
var selRef = app.activeDocument.all;
var textColor = new SolidColor();
textColor.rgb.red = 0;
textColor.rgb.green = 140
textColor.rgb.blue = 200;
var bgColor = new SolidColor();
bgColor.rgb.red = 140;
bgColor.rgb.green = 125;
bgColor.rgb.blue = 150;
backgroundColor = bgColor;
docRef.selection.selectAll(); docRef.selection.fill(backgroundColor); docRef.selection.deselect();
newTextLayer.textItem.contents = newText.replace (/%20/g, "");
var doc = app.activeDocument;
var docName = doc.name;
docName = docName.match(/(.*)(\.[^\.]+)/) ? docName = docName.match(/(.*)(\.[^\.]+)/):docName = [docName, docName];
var saveName = new File(decodeURI(doc.path)+'/'+docName[1]+'.jpg');
saveJPEG( app.activeDocument, saveName, 10 );
// Example of Reading all Files in a Folder
// and creating Textlayers from its filenames
// enable double clicking from the Macintosh Finder or the Windows Explorer
#target photoshop
// in case we double clicked the file
app.bringToFront();
// debug level: 0-2 (0:disable, 1:break on error, 2:break at beginning)
// $.level = 0;
// debugger; // launch debugger on next line
var strtRulerUnits = app.preferences.rulerUnits;
var strtTypeUnits = app.preferences.typeUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.POINTS;
var docRef = app.documents.add(1280, 720, 72,);
var selRef = app.activeDocument.all;
var textColor = new SolidColor();
textColor.rgb.red = 255;
textColor.rgb.green = 255
textColor.rgb.blue = 255;
var bgColor = new SolidColor();
bgColor.rgb.red = 99;
bgColor.rgb.green = 185;
bgColor.rgb.blue = 232;
backgroundColor = bgColor;
docRef.selection.selectAll(); docRef.selection.fill(backgroundColor); docRef.selection.deselect();
// suppress all dialogs
app.displayDialogs = DialogModes.NO;
try {
// Ask user for input folder
var inputFolder = Folder.selectDialog("select Folder");
var fileList = inputFolder.getFiles("*from*");
for (var i = 0; i < fileList.length; i++) {
// split example
var explodedName = fileList[i].name.split("from");
var newText = explodedName[0] +String.fromCharCode(13)+"from"+String.fromCharCode(13)+explodedName[1];
//var newText = fileList[i].name;
var fontName = "Philosopher";
var clearName = newText.replace (/%20/g, " ");
var clearerName = clearName.replace (/.mp4/g,"");
var newTextLayer = docRef.artLayers.add();
newTextLayer.kind = LayerKind.TEXT;
newTextLayer.textItem.contents = clearerName;
newTextLayer.textItem.position = Array(200, 450+i*36);
newTextLayer.textItem.size = 36;
newTextLayer.textItem.color = textColor;
newTextLayer.textItem.font = fontName;
activeDocument.flatten();
saveFile = new File("/C/2 CC Attribution Share Alike/"+fileList[i].name.replace (/.mp4/g,"")+".jpg");
saveOptions = new JPEGSaveOptions();
saveOptions.embedColorProfile = true;
saveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
saveOptions.matte = MatteType.NONE;
saveOptions.quality = 9;
activeDocument.saveAs(saveFile, saveOptions, true,Extension.LOWERCASE);
//activeDocument.close(SaveOptions.DONOTSAVECHANGES) ;
}
}
catch (exception) {
alert(exception);
}
finally {
app.displayDialogs = startDisplayDialogs;
}
app.preferences.rulerUnits = strtRulerUnits;
app.preferences.typeUnits = strtTypeUnits;
docRef = null;
textColor = null;
newTextLayer = null;