Copy link to clipboard
Copied
Dear Friends
I need batch processer for the CTLP to Tiff conversion Script. I got one script from the Esko but is working in individual images but I want to create a bunch of CTLP image in one folder. It needs to convert.
Below script for your reference.
- /**
- * Sample scripts are provided as-is with no warranty of fitness for a particular purpose.
- * These scripts are solely intended to demonstrate techniques for accomplishing common tasks.
- * Additional script logic and error-handling may need to be added to achieve the desired results in your specific environment.
- *
- * It is up to the user to verify that his intended use of the offered automation functionality is compliant with any third party license agreement and/or other restrictions applicable to any non-Esko products.
- */
- inputs = ["~/Desktop/ctlp/Bear_Transparency_CT.ct"]
- outputFolder = "~/Desktop"
- for (i=0;i<inputs.length;i++)
- {
- var fileRef = new File(inputs);
- openctlp(fileRef);
- docRef = app.activeDocument;
- outputFile = new File(outputFolder + "/"+ fileRef.name);
- var TiffSaveOptions = new TiffSaveOptions();
- TiffSaveOptions.transparency = true;
- TiffSaveOptions.embedColorProfile = true;
- docRef.saveAs(outputFile, TiffSaveOptions, true, Extension.LOWERCASE);
- docRef.close(SaveOptions.DONOTSAVECHANGES);
- }
- function openctlp()
- {
- var idOpn = charIDToTypeID( "Opn " );
- var desc35 = new ActionDescriptor();
- var idnull = charIDToTypeID( "null" );
- desc35.putPath( idnull, fileRef );
- var idAs = charIDToTypeID( "As " );
- var desc36 = new ActionDescriptor();
- var idktra = charIDToTypeID( "ktra" );
- desc36.putBoolean( idktra, true );
- var idkgrd = charIDToTypeID( "kgrd" );
- desc36.putBoolean( idkgrd, false );
- var idisol = charIDToTypeID( "isol" );
- desc36.putInteger( idisol, 0 );
- var idEskoEskoCTLPFormat = stringIDToTypeID( "Esko Esko CT/LP Format" );
- desc35.putObject( idAs, idEskoEskoCTLPFormat, desc36 );
- executeAction( idOpn, desc35, DialogModes.NO );
- }
Thanks in Advance
Kalaimani .S
Hi,
Although I have updated the code shared by so that you can run this process for all files in the selected folder. Above script process only one file because it has a single file in inputs.
Here is the updated code.
...
var folder = Folder.selectDialog ('Select the folder for processing.')
var files = folder.getFiles('*.ct');
outputFolder = "~/Desktop"
for (i=0;i<files.length;i++)
{
var fileRef = new File(files);
openctlp(fileRef);
docRef = app.activeDocument;
outputFile = ne
Copy link to clipboard
Copied
Are you really sure that this the right forum is?
Your code shows Photoshops Action Manager Code (AM-code). There is no equivalent in Illustrator scripting. Should I move your thread into Photoshop scripting?
Copy link to clipboard
Copied
I don't know how to move the Photoshop Scripting. Kindly advice me.
Copy link to clipboard
Copied
Hi,
You can post your question in the Photoshop Scripting forum.
Here is the link for the same
Thanks
Charu
Copy link to clipboard
Copied
Hi,
Although I have updated the code shared by so that you can run this process for all files in the selected folder. Above script process only one file because it has a single file in inputs.
Here is the updated code.
var folder = Folder.selectDialog ('Select the folder for processing.')
var files = folder.getFiles('*.ct');
outputFolder = "~/Desktop"
for (i=0;i<files.length;i++)
{
var fileRef = new File(files);
openctlp(fileRef);
docRef = app.activeDocument;
outputFile = new File(outputFolder + "/"+ fileRef.name);
var TiffSaveOptions = new TiffSaveOptions();
TiffSaveOptions.transparency = true;
TiffSaveOptions.embedColorProfile = true;
docRef.saveAs(outputFile, TiffSaveOptions, true, Extension.LOWERCASE);
docRef.close(SaveOptions.DONOTSAVECHANGES);
}
function openctlp()
{
var idOpn = charIDToTypeID( "Opn " );
var desc35 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
desc35.putPath( idnull, fileRef );
var idAs = charIDToTypeID( "As " );
var desc36 = new ActionDescriptor();
var idktra = charIDToTypeID( "ktra" );
desc36.putBoolean( idktra, true );
var idkgrd = charIDToTypeID( "kgrd" );
desc36.putBoolean( idkgrd, false );
var idisol = charIDToTypeID( "isol" );
desc36.putInteger( idisol, 0 );
var idEskoEskoCTLPFormat = stringIDToTypeID( "Esko Esko CT/LP Format" );
desc35.putObject( idAs, idEskoEskoCTLPFormat, desc36 );
executeAction( idOpn, desc35, DialogModes.NO );
}
In the updated version of the script first, it will ask you to select the folder and then it will process all files with .ct extension present in the selected folder.
Hope this helps you.
Copy link to clipboard
Copied
Dear charur
Thanks for your help. it's very useful for the conversion.
Copy link to clipboard
Copied
charur94718007 schrieb
Hi,
You can post your question in the Photoshop Scripting forum …
Please, don't do this. Double threads and double post are not welcome.
@lara@7 wrote
I don't know how to move the Photoshop Scripting. Kindly advice me.
Only moderators and some staff members can do that.
Moved from Illustrator Scripting to Photoshop Scripting
Find more inspiration, events, and resources on the new Adobe Community
Explore Now