• 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.3K

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

LATEST

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