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

Export File as TIFF... no file saved

Participant ,
Oct 02, 2017 Oct 02, 2017

Copy link to clipboard

Copied

Could someone take a look at my script and see if you can get a file to be saved as a TIFF?  VBscript is my main language so maybe I missed something in JavaScript.  The script will run... I see an AI progress window open 'writing TIFF file", no error messages but then no file is saved?

function test(){ 

     var doc = app.activeDocument; 

     var opts = new ExportOptionsTIFF();

     var destFile = new File("C:\TIFF Test\SOCAL_CN68_resx.tif");

     var type = ExportType.TIFF;

          opts.resolution=72;

          opts.imageColorSpace.Grayscale;

          opts.AntiAliasing=AntiAliasingMethod.ARTOPTIMIZED;

          opts.IZWCompression=false;

          opts.artboardRange="1";

     doc.exportFile(destFile, type, opts);

test();

TOPICS
Scripting

Views

1.6K

Translate

Translate

Report

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

Community Expert , Oct 04, 2017 Oct 04, 2017

There are some typos:

function test(){

var doc = app.activeDocument;

var destFile = new File("/d/Test/SOCAL_CN6811_resx.tif");

var type = ExportType.TIFF;

var opts = new ExportOptionsTIFF();

opts.imageColorSpace = ImageColorSpace.GrayScale;

opts.resolution=144;

opts.antiAliasing=AntiAliasingMethod.ARTOPTIMIZED;

opts.lZWCompression=false;

opts.saveMultipleArtboards = true;

opts.artboardRange="1";

doc.exportFile(destFile, type, opts);

}

test();

Have fun

Votes

Translate

Translate
Adobe
Valorous Hero ,
Oct 03, 2017 Oct 03, 2017

Copy link to clipboard

Copied

For Windows paths, make sure to escape the backslashes like so: "\\"

Votes

Translate

Translate

Report

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
Participant ,
Oct 03, 2017 Oct 03, 2017

Copy link to clipboard

Copied

Ah, that helped but now a new issue, an AI Export window appears.  I need to be able to just save with my options without user interaction. 

Votes

Translate

Translate

Report

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
Participant ,
Oct 03, 2017 Oct 03, 2017

Copy link to clipboard

Copied

FYI - Don't know if this makes any difference but I am running the JS thru a VBscript like so:

Set App = CreateObject("Illustrator.Application")

Set FSO = CreateObject("Scripting.FileSystemObject")

App.DoJavaScriptFile "C\SaveAsTIFF.js"

Votes

Translate

Translate

Report

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
Valorous Hero ,
Oct 03, 2017 Oct 03, 2017

Copy link to clipboard

Copied

I can't see why the dialog would appear as a result of this command, but you can try to turn off dialogs via app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;

Votes

Translate

Translate

Report

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
Participant ,
Oct 03, 2017 Oct 03, 2017

Copy link to clipboard

Copied

Strange.. it has no effect!?  Reading up on it sounds like exactly what I need.

Mmmm... would you mind running the script and see if the dialog window opens on your pc?  I am gonna try on my main oc when I get home.

Votes

Translate

Translate

Report

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
Valorous Hero ,
Oct 03, 2017 Oct 03, 2017

Copy link to clipboard

Copied

Maybe make sure your destination path really exists, because it seems to be working for me with no problem. However, I set my destination path to some folder on my desktop and not at the root.

Votes

Translate

Translate

Report

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 ,
Oct 03, 2017 Oct 03, 2017

Copy link to clipboard

Copied

Please try:

var destFile = new File("/d/Test/SOCAL_CN68_resx.tif");

Have fun

Votes

Translate

Translate

Report

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
Participant ,
Oct 04, 2017 Oct 04, 2017

Copy link to clipboard

Copied

So with further testing I was able to export a TIFF (thanks pixxxel schubser for the forward slash suggestion), and I don't even need the "DONTDISPLAYALERTS" as well.

But now I see none of the options are being used.  Been trying all together and one at a time.

Here's my latest version using paths I would typically use:

function test(){

    var doc = app.activeDocument;    

    var destFile = new File("/S/SOCAL/Section_32/Light TIFFs/SOCAL_CN68_resx.tif");

    var type = ExportType.TIFF;

    var opts = new ExportOptionsTIFF();

        opts.imageColorSpace.Grayscale;

        opts.resolution=72;

        opts.AntiAliasing=AntiAliasingMethod.ARTOPTIMIZED;

        opts.IZWCompression=false;

        opts.artboardRange="1";

    doc.exportFile(destFile, type, opts);

    } 

test();

Votes

Translate

Translate

Report

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 ,
Oct 04, 2017 Oct 04, 2017

Copy link to clipboard

Copied

There are some typos:

function test(){

var doc = app.activeDocument;

var destFile = new File("/d/Test/SOCAL_CN6811_resx.tif");

var type = ExportType.TIFF;

var opts = new ExportOptionsTIFF();

opts.imageColorSpace = ImageColorSpace.GrayScale;

opts.resolution=144;

opts.antiAliasing=AntiAliasingMethod.ARTOPTIMIZED;

opts.lZWCompression=false;

opts.saveMultipleArtboards = true;

opts.artboardRange="1";

doc.exportFile(destFile, type, opts);

}

test();

Have fun

Votes

Translate

Translate

Report

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
Participant ,
Oct 05, 2017 Oct 05, 2017

Copy link to clipboard

Copied

That did it my friend!   A big thanks to all!

Votes

Translate

Translate

Report

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
Enthusiast ,
Jun 16, 2024 Jun 16, 2024

Copy link to clipboard

Copied

It's a typo in the developer's manual. It causes incorrect scripts to be written. Vote on Uservoice.

Correct:  opts.lZWCompression (l - lowercase L, not I - lowercase i).

Votes

Translate

Translate

Report

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
Enthusiast ,
Jun 21, 2024 Jun 21, 2024

Copy link to clipboard

Copied

In my experience, this is a broken attribute on Adobe's part. The profile was not embedded in the TIFF and they don't fix it.I created an action with all the TIFF settings I needed and embedded it in the script.

Votes

Translate

Translate

Report

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
New Here ,
Jun 22, 2024 Jun 22, 2024

Copy link to clipboard

Copied

Could you share it with me for learning purposes? The "Illustrator JavaScript Scripting Reference.pdf" has so many errors, which is causing me a lot of frustration. Thank you again for your response, it helped me understand this point.


[Personal Information removed by moderator]

Votes

Translate

Translate

Report

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
Enthusiast ,
Jun 22, 2024 Jun 22, 2024

Copy link to clipboard

Copied

I'm talking about the app.doScript("your-name", "TIFF") command, which runs the recorded action.

SergeyOsokin_1-1719114026851.png

Votes

Translate

Translate

Report

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
New Here ,
Jun 22, 2024 Jun 22, 2024

Copy link to clipboard

Copied

Sure, I have this confusion as well and cannot embed ICC to export TIF. Could you share how you achieved it?

 

Votes

Translate

Translate

Report

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
Enthusiast ,
Jun 23, 2024 Jun 23, 2024

Copy link to clipboard

Copied

LATEST

@fr38194700bj81 @笠間38198967ieha  I created a Uservoice about embedding profiles where I talked about how the feature is broken after CS6. Take a vote https://illustrator.uservoice.com/forums/908050-illustrator-desktop-sdk-scripting-issues/suggestions...

Votes

Translate

Translate

Report

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