secuencias de comandos de Photoshop - ruta como variable
Frecuentes
Visto 3,155 equipos
1
esto funciona bien, abre el pdf en la carpeta
#target photoshop
app.bringToFront();
var path = 'C:/PhotoshopPortable/'
// A hard coded path to a directory 'mac style'
var processFolder = Folder('C:/PhotoshopPortable/')
// Use folder object get files function with mask 'a reg ex'
var fileList = processFolder.getFiles(/\.(pdf)$/i);
// Loop through files
for (var i = 0; i < fileList.length; i++) {
// Only process the returned file objects
// The filter 'should' have missed out any folder objects
if (fileList[i] instanceof File && fileList[i].hidden == false) {
// get a reference to the new document
var docRef = open(fileList[i])
// save and close
saveJPEG(new File('C:/PhotoshopPortable/' + app.activeDocument.name + ".jpg"), 12)
app.activeDocument.close();
}
}
function saveJPEG(saveFile, jpegQuality){
var doc = activeDocument;
if (doc.bitsPerChannel != BitsPerChannelType.EIGHT) doc.bitsPerChannel = BitsPerChannelType.EIGHT;
jpgSaveOptions = new JPEGSaveOptions();
jpgSaveOptions.embedColorProfile = true;
jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
jpgSaveOptions.matte = MatteType.NONE;
jpgSaveOptions.quality = jpegQuality;
activeDocument.saveAs(saveFile, jpgSaveOptions, true,Extension.LOWERCASE);
}
pero esto no:
var path = 'C:/PhotoshopPortable/'
var processFolder = Folder(path)
abre un archivo desconocido con el texto de la licencia (Mozilla ???).
no necesito el cuadro de diálogo de la carpeta, solo quiero tener la ruta de trabajo en una variable.
1 Respuestas
2
el nombre de la variable "ruta" era el problema. Cambiarlo a "workingDir" resolvió el problema.
Respondido 18 Feb 14, 18:02
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas javascript photoshop or haz tu propia pregunta.
intenta formatear tu ruta como '/c/carpeta/' - Anna Forrest