Copy link to clipboard
Copied
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
}
}
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.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+
Copy link to clipboard
Copied
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
); }
}
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.exportFile( ExportFormat.JPG, expFile, false );
};
};
main();
Copy link to clipboard
Copied
That did it! Thank you so much!!!! XD
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Looks like you might be running it against the ESTK and not InDesign. You might want to put #target indesign as the first line to force it.
Copy link to clipboard
Copied
solutions (any will do just fine):
1) RUN THE SCRIPT FORM THE SCRIPTS PANEL IN INDESIGN!!
2) add #target indesign as the first line in the script
3) in ESTK, next to the little green chain icon there is a doprdown list where now it sais "ExtendeScript bla bla". Change it there to Indesign
Copy link to clipboard
Copied
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
); }
}
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.exportFile( ExportFormat.JPG, expFile, false );
};
};
main();
Unfortunately scripts gaves me always JPGS with resolution 72dpi. Can you help me somwehow
thanks
Mattijjah