Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Batch processer for the CTLP to Tiff conversion

Explorer ,
May 20, 2019 May 20, 2019

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.

  1. /**
  2. * Sample scripts are provided as-is with no warranty of fitness for a particular purpose.
  3. * These scripts are solely intended to demonstrate techniques for accomplishing common tasks.
  4. * Additional script logic and error-handling may need to be added to achieve the desired results in your specific environment.
  5. *
  6. * 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.
  7. */ 
  8. inputs = ["~/Desktop/ctlp/Bear_Transparency_CT.ct"] 
  9. outputFolder = "~/Desktop" 
  10.  
  11. for (i=0;i<inputs.length;i++) 
  12.     var fileRef = new File(inputs); 
  13.     openctlp(fileRef); 
  14.     docRef = app.activeDocument; 
  15.  
  16.     outputFile = new File(outputFolder + "/"+ fileRef.name); 
  17.     var TiffSaveOptions = new TiffSaveOptions(); 
  18.     TiffSaveOptions.transparency = true; 
  19.     TiffSaveOptions.embedColorProfile = true; 
  20.     docRef.saveAs(outputFile, TiffSaveOptions, true, Extension.LOWERCASE); 
  21.     docRef.close(SaveOptions.DONOTSAVECHANGES); 
  22.  
  23. function openctlp() 
  24. var idOpn = charIDToTypeID( "Opn " ); 
  25.     var desc35 = new ActionDescriptor(); 
  26.     var idnull = charIDToTypeID( "null" ); 
  27.     desc35.putPath( idnull, fileRef ); 
  28.     var idAs = charIDToTypeID( "As  " ); 
  29.         var desc36 = new ActionDescriptor(); 
  30.         var idktra = charIDToTypeID( "ktra" ); 
  31.         desc36.putBoolean( idktra, true ); 
  32.         var idkgrd = charIDToTypeID( "kgrd" ); 
  33.         desc36.putBoolean( idkgrd, false ); 
  34.         var idisol = charIDToTypeID( "isol" ); 
  35.         desc36.putInteger( idisol, 0 ); 
  36.     var idEskoEskoCTLPFormat = stringIDToTypeID( "Esko Esko CT/LP Format" ); 
  37.     desc35.putObject( idAs, idEskoEskoCTLPFormat, desc36 ); 
  38. executeAction( idOpn, desc35, DialogModes.NO ); 

Thanks in Advance

Kalaimani .S

TOPICS
Actions and scripting
868
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , May 20, 2019 May 20, 2019

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

...
Translate
Adobe
Community Expert ,
May 20, 2019 May 20, 2019

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 20, 2019 May 20, 2019

I don't know how to move the Photoshop Scripting. Kindly advice me.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 20, 2019 May 20, 2019

Hi,

You can post your question in the Photoshop Scripting forum.

Here is the link for the same

Photoshop Scripting

Thanks

Charu

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 20, 2019 May 20, 2019

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 20, 2019 May 20, 2019

Dear

Thanks for your help. it's very useful for the conversion.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 21, 2019 May 21, 2019
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines