Hello-
I am trying to run the following script in ID (CS6) to export grouped items in all open documents as jpegs. Extendscript Toolkit is giving me this error: "Target Adobe InDesign CS4 (6.0) provides no engine for debugging", and the drop down menu at the top keeps switching from CS6 to CS4. Can anyone see something in the script that would cause that, or is there something else I need to do to get it to work?
Thanks!
T
#target indesign
var saveFold;
function main(){
saveFold = Folder( Folder.desktop + '/Batch' );
if ( ! saveFold.exists ) { saveFold.create(); }
var prfs;
prfs = app.jpegExportPreferences;
if ( parseInt( app.version ) >= 7 ) {
prfs.antiAlias = true;
prfs.embedColorProfile = true;
prfs.exportResolution = 300;
prfs.jpegColorSpace = JpegColorSpaceEnum.RGB;
prfs.jpegQuality = JPEGOptionsQuality.MAXIMUM;
prfs.simulateOverprint = true;
};
if ( parseInt( app.version ) == 6 ) {
prfs.resolution = 200;
prfs.jpegQuality = JPEGOptionsQuality.MAXIMUM;
prfs.jpegRenderingStyle = JPEGOptionsFormat.BASELINE_ENCODING;
};
for (var j=0; j<app.documents.length;j++){
groupsToJPEGs (app.documents[j]);
}
}
function groupsToJPEGs(doc) {
var i, grps, expFile;
grps = doc.groups;
for ( i = 0; i < grps.length; i++ ) {
expFile = File( saveFold + '/'+ doc.name + '_' + ( i + 1 ) + '.jpg' );
doc.groups[i].exportFile( ExportFormat.JPG, expFile, false );
};
};
main();
try this:
var saveFold;
function main(){
saveFold = Folder( Folder.desktop + '/Batch' );
if ( ! saveFold.exists ) { saveFold.create(); }
var prfs;
prfs = app.jpegExportPreferences;
prfs.antiAlias = true;
prfs.embedColorProfile = true;
prfs.exportResolution = 300;
prfs.jpegColorSpace = JpegColorSpaceEnum.RGB;
prfs.jpegQuality = JPEGOptionsQuality.MAXIMUM;
prfs.simulateOverprint = true;
for (var j=0; j<app.documents.length;j++){
groupsToJPEGs (app.documents[j]);
}
}
function groupsToJPEGs(doc) {
var i, grps, expFile;
grps = doc.groups;
for ( i = 0; i < grps.length; i++ ) {
expFile = File( saveFold + '/'+ doc.name + '_' + ( i + 1 ) + '.jpg' );
doc.groups[i].exportFile( ExportFormat.JPG, expFile, false );
};
};
main();
Hi there-
This worked fine for the first batch of test files, but as soon as I tried to demo it for the artist who will be using the script, I got the attached error. I tried it on the same files I tested it with before, so I'm not sure what could cause the issue. Any suggestions? Could the version of ESTK matter (I'm pretty sure I did most of my testing on the CS4 version, but upgraded to CS6 in the meantime).
Thanks!
T
Hello
I'm trying to work with this script in InD CS3, but I have one problem. Script doesn't read export preferences.
I changed script a little (delete part for newest versions) and it looks like that:
#target indesign
var saveFold;
function main(){
saveFold = Folder( Folder.desktop + '/Batch' );
if ( ! saveFold.exists ) { saveFold.create(); }
var prfs;
prfs = app.jpegExportPreferences;
prfs.resolution = 200;
prfs.jpegQuality = JPEGOptionsQuality.MAXIMUM;
prfs.jpegRenderingStyle = JPEGOptionsFormat.BASELINE_ENCODING;
for (var j=0; j<app.documents.length;j++){
groupsToJPEGs (app.documents[j]);
}
}
function groupsToJPEGs(doc) {
var i, grps, expFile;
grps = doc.groups;
for ( i = 0; i < grps.length; i++ ) {
expFile = File( saveFold + '/'+ doc.name + '_' + ( i + 1 ) + '.jpg' );
doc.groups[i].exportFile( ExportFormat.JPG, expFile, false );
};
};
main();
Unfortunately scripts gaves me always JPGS with resolution 72dpi. Can you help me somwehow
thanks
Mattijjah
North America
Europe, Middle East and Africa
Asia Pacific