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

importPrintPreset, is it broken?

Community Expert ,
Feb 16, 2014 Feb 16, 2014

Copy link to clipboard

Copied

Hi everyone,

has anyone had any luck with importPrintPreset()? I can't get it to import any presets, I get no errors, it just doesn't do anything...

var idoc = app.activeDocument;

var file = new File('c:/temp/printPresetFile');

idoc.importPrintPreset ('presetName', file);

using CS5, win 7

TOPICS
Scripting

Views

1.9K

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
Adobe
Mentor ,
Feb 17, 2014 Feb 17, 2014

Copy link to clipboard

Copied

Hi Carlos,

It's not something I have ever used or tried. You mention it's "broken" does that mean you had used it successfully before and now it wont work, or it was broken to begin with and never worked? Like a special Adobe "feature" not tested properly but released and not documented properly. 😉

Anything happen after you load it and try to then you use: printPresetsList (or) showPresets

I cant seem to find much at all on it or people even using it or talking about it? I found this: http://3fm.blog.so-net.ne.jp/2013-07-22-1 (but that does not seem to be relative to loading). I also quickly looked through the ID scripting forum thinking it may be relative to both, maybe not however.

Sorry I am not much help.

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 ,
Feb 17, 2014 Feb 17, 2014

Copy link to clipboard

Copied

Hi, I don't know if it worked in previous versions, or if it works in newer versions, first time trying to work with it. I'm trying to replicate what we do manually going to

Edit->Print Presets...->Import...

nothing happens, I get no errors, it just doesn't load any presets.

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
Engaged ,
Feb 17, 2014 Feb 17, 2014

Copy link to clipboard

Copied

Howdy Carlos,

I found this one thread https://groups.google.com/forum/#!topic/macenterprise/2e__jpZkF2k but it looks like this lad didn't fare much better. I'll try to give it a shot on W7/CS6 and let you know.

TT

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 ,
Feb 17, 2014 Feb 17, 2014

Copy link to clipboard

Copied

Hi, thanks for checking, I suspect this comment refers to importing manually

"Doing an import of the same file through Illustrator did work ..."

my other option, would be to update the Print Preset file itself and over write the old, but I'm not sure if I could do that while illustrator is running, and I guess I would have to restart illustrator to be able to pick up the new Presets...I haven't tried that yet...re-starting is not an option.

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
Engaged ,
Feb 17, 2014 Feb 17, 2014

Copy link to clipboard

Copied

Carlos,

SInce my post, I've been looking for Print Preset files to try to import one and can't find one. I've looked everywhere. Where are they kept? Or can you PM me one that I can try to import? I can do this just fine with PDF Presets - that works. Interestingly enough, the library lists the syntax as:

     ImportPDFPreset(FIleSpec as String, [ReplacingPreset As Object])

To me - it seems opposite from the PrintPreset Import which is:

     ImportPrintPreset(PrintPreset As String, FileSpec as String)

Just for giggles, have you tried to reverese the parameters? Wouldn't be the first time that the documentation was "off"...

I'd really like to help if I can.

Thanks,

TT

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 ,
Feb 17, 2014 Feb 17, 2014

Copy link to clipboard

Copied

hahaha, it is possible the documentation is wrong, based on your post (and on your history) you're trying with .Net, right? I tried also with VBA and interestingly enough

in VB - ImportPrintPreset(PrintPreset As String, FileSpec as String)

in JS - ImportPrintPreset(PrintPreset As String, File as FileObject)

I didn't try reversing, but I did try with strings and/or objects and it failed, the debugger correctly identified the needed parameters types, so it seems the documentation is correct.

--------------------------

you can make your own preset file,

Edit->Print Presets...->Export...

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
Mentor ,
Feb 17, 2014 Feb 17, 2014

Copy link to clipboard

Copied

I can't seem to yeild any results either in my testing ( osx cs5 )

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
Engaged ,
Feb 17, 2014 Feb 17, 2014

Copy link to clipboard

Copied

Hi Carlos,

Yes, I'm working in VB.Net. 🙂

you can make your own preset file,

Edit->Print Presets...->Export...

Haha. Wow -- why didn't I think of that? 😞

So I tested it and the same thing happens -- NOTHING.  I tried reversing the parameters and got an error. It looks like Pixxxel Schubser's work around might be a solution, although I haven't tested it. I'm wondering how the line

app.documents[0].importPrintPreset ('TheNameOfYourPreset',thePrintPreset);

will work, since it looks to me to be pretty similar to what is not working now.

Sorry I couldn't help any further.

Best regards,

TT

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 ,
Feb 17, 2014 Feb 17, 2014

Copy link to clipboard

Copied

I'm wondering how the line

app.documents[0].importPrintPreset ('TheNameOfYourPreset',thePrintPreset);

will work, since it looks to me to be pretty similar to what is not working now.

my thought exactly, at first I thought the presets do get loaded to memory, and that's were this line was getting the info from

thePrintOptions.printPreset = 'TheNameOfYourPreset';

but it did not work

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 ,
Feb 17, 2014 Feb 17, 2014

Copy link to clipboard

Copied

Hello CarlosCanto,

I don't know if the syntax or the documantation is buggy, but it doesn't work in CS3 and also not in CS5.

The only help I can give you is a little workaround:

Instead to load the preset, you can print directly with a named preset from a preset file.

Try this (in the example you need a preset file):

// pixxxelschubser  2014/17/Jan

// http://forums.adobe.com/message/6129969#6129969

var thePrintPreset = File("~/Desktop/TestFolder/ExamplePPD"); // or where your preset file exist

app.documents[0].importPrintPreset ('TheNameOfYourPreset',thePrintPreset);

var thePrintOptions = new PrintOptions();

thePrintOptions.printPreset = thePrintPreset;

app.activeDocument.print(thePrintOptions);

This works for me.

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 ,
Feb 17, 2014 Feb 17, 2014

Copy link to clipboard

Copied

Hi pixxxel, thanks for your input

it is not working on my side, are you positive it works? did you delete the preset by hand before importing/loading

if I try your code, it does not print at all, unless I have the preset loaded already, then it prints correctly with the preset I need, but I had to change the line below with a string (instead of the file reference)

var thePrintPreset = File("~/Desktop/TestFolder/ExamplePPD");

//thePrintOptions.printPreset = thePrintPreset; // here printPreset expects a string, not a file

thePrintOptions.printPreset = "presetName";

also, the requirement is to "load" the preset, not to print it directly with the script. I guess, the art will go to a different department, get some more work done, then it'll get printed there.

since we don't always get what we want with Illustrator, I may settle with printing the file via a separate script, and go with your approach, but I can't get it to work either.

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 ,
Feb 18, 2014 Feb 18, 2014

Copy link to clipboard

Copied

var idoc = app.activeDocument;
 
 
var file = new File('c:/temp/printPresetFile');
idoc.importPrintPreset ('presetName', file);

it seems like it does work after all, kind of...after the script runs, the actual preset does not load as we have seen, but all the preset settings do get loaded!! yey!! so the file can be printed right away, the file can be closed (as well as the application), reopened and the settings are there, so it can be printed by someone else...if you change the settings or pick another preset, then the settings are lost forever.

...still official documentation reads "Loads the named preset" not "Loads the named preset settings"

importPrintPreset(printPreset,fileSpec) /*string*/ /*File*/

Loads the named print preset from the file.

thanks W_J_T, TT, pixxxel, for helping out

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
Engaged ,
Feb 18, 2014 Feb 18, 2014

Copy link to clipboard

Copied

Hi Carlos,

Thanks for your persistence and also for sharing your results. I tried it again after reading your last post by adding or deleting a preset and then trying to restore the original export (now that someone enlightened me on how to do that! ;-)) and I see changes to the current 'Print Presets' file (date/time/content changes) but nothing is visibly changed to the menu item even after I close and reload the app. Thinking that the changes were particular to the document, I saved a document and reopened it and still no changes.

It's certainly not critical for you to worry about this for me, but perhaps if you see something that I am missing or not doing correctly, please let me know.

Always a pleasure to assist. 🙂

Kindest regards!

-TT

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
Mentor ,
Feb 18, 2014 Feb 18, 2014

Copy link to clipboard

Copied

LATEST

Interesting discovery, great job CarlosCanto thanks for sharing your findings.

Hence, yet another mystery feature in the documentation given some light from the dark realms of Adobe obscurity.

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