Cannot set the printBlack printPreference in InDesign

I am finding myself running into a brick wall and it is upsetting me greatly. It's a problem with setting the printPreferences for a document. Here is the code I have:
    with(document.printPreferences) {
        activePrinterPreset = outputPreset;
        pageRange = outputRange;
        for (var j = 0; j < allInks.length; j++) {
            document.inks.item(allInks[j]).printInk = false;
        for (var k = 0; k < printInks.length; k++) {
            if (printInks[k].toString() === "Black") {
                $.writeln("Found Black!");
                printBlack = true;
                $.writeln("Set Black!");
            } else {
                document.inks.item(printInks[k]).printInk = true;
        if (offsetJob) {
            // If it's an offset job, we might need to change page sizes.
            if (productType === "HI-N13W") {
                paperSize = PaperSizes.custom;
                paperHeight = 12.5;
                paperWidth = 8.5;
            } else if (productType.subString(3,5) === "PC") {
                paperSize = PaperSizes.custom;
                paperHeight = 8;
                paperWidth = 12.5;
            } else if (couldBeBothJobs.toString().indexOf(productType.subString(3,5)) > -1) {
                paperSize = "US Letter";
            } else {
                paperSize = PaperSizes.custom;
                paperHeight = 8;
                paperWidth = 25;
In the first FOR loop, you'll see that I have first turned off ALL of the inks in the document for printing. I then only turn on the ones in the "printInks" array in the second FOR loop. If, however, the word "Black" exists in the array, there isn't an Ink for it, so instead, I want to set the built-in printPreference "printBlack". (Which complements the other three—printCyan, printMagenta, and printYellow.)
It's just supposed to be a boolean value, according to the InDesign CS6 Object Model Reference. However, whenever the script gets to that point, it halts. Pasting just that small bit of code to a fresh document, just so I can see the error message, gets me this:
    The property is not applicable in the current state.
Huh? What does this mean? And more importantly, how can I fix it? I know that trapping has to be off before this property can be set, but I've definitely made sure that it is off. Can anyone please help?

Yes, that took care of it.  Instead of invoking an existing Print Preset, I just created a new, temporary one and gave it all of the properties of the existing one.  Thus, the result is:
            with(document.printPreferences) {
                tempPreset.printer = Printer.POSTSCRIPT_FILE;
                tempPreset.ppd = "OYO Imagesetter";
                tempPreset.pagePosition = PagePositions.CENTERED;
                tempPreset.paperSize = PaperSizes.CUSTOM;
                tempPreset.paperHeight = "12.5 in";
                tempPreset.paperWidth = "6.5 in";
                tempPreset.colorOutput = ColorOutputModes.SEPARATIONS;
                tempPreset.trapping = Trapping.OFF;
                tempPreset.screening = "60 lpi / 600 dpi";
                tempPreset.sendImageData = ImageDataTypes.OPTIMIZED_SUBSAMPLING;
                pageRange = outputRange;
                // Now let's turn off all of the CMYK colors.
                tempPreset.printCyan = false;
                tempPreset.printMagenta = false;
                tempPreset.printYellow = false;
                tempPreset.printBlack = false;
                // Then we turn back on BLACK if it exists.
                for (var k = 0; k < printInks.length; k++) {
                    if (printInks[k] === "Black") {
                        tempPreset.printBlack = true;
                    } else {
                        document.inks.item(printInks[k]).printInk = true;
                // If this is a four-color process job, then turn back on all of the process colors.
                if (processJob) {
                    tempPreset.printCyan = true;
                    tempPreset.printMagenta = true;
                    tempPreset.printYellow = true;
                    tempPreset.printBlack = true;
                // That concludes OYO seps.
            var mydpp = document.printPreferences;
            mydpp.activePrinterPreset = "tempPreset";
It could still use some work, but otherwise this is quite functional and works great!  Thanks, Jump_Over!

Similar Messages

  • In iMovie 11 I cannot set the duration of my photos, iMovie 09 allowed this , anyone know what to do?

    In iMovie 11, I cannot set the duration of the photos, iMovie 09 allowed this, anybody know the solution?  I use transitions between photos and want to set the timing because I am setting the whole thing to music.

    I have been unable to find this error on the help pages
    Error 1413 when Updating or Restoring an iPod

  • I wish to set a repeat for an event but I do not get a customise option on my iphone 4s so cannot set the third monday of the month - only day, weekly 2 weekly monthly or annually - how do I resolve the problem ?

    I wish to set a repeat for an event but I do not get a customise option on my iphone 4s so cannot set the third monday of the month - only day, weekly 2 weekly monthly or annually - how do I resolve the problem ?

    Week Cal uses the calender database already on your phone. It's just a different front end.

  • Xcelsius Scenario Button cannot set the Default Scenario

    Hi,
    I am facing a problem with the Scenario Button in Xcelsius the problem is i cannot set the Default Scenario in the Dashboard .
    I can save load delete the the scenario but if i have 3 scenario and i want to make one of them as default is does not work.
    I think there is some browser setting for this and i have already configured the storage setting for the browser .
    Warm Regards,
    Mishra Vibhav

    Hi Thijs
    Thanks for your update, I think this really helps me. And I have one more question.
    I have seen a SAP notes regarding the Scenario function, the content is as below.
    You use the Local Scenario button to save the final result of a specific simulation (created scenario) and return to it in the future. It only saves the scenario on the local machine where it was created. So you can access the scenario from the same machine, but you cannot transfer scenarios from one computer to another.
    As per the note we can't transfer scenarios from one computer to another, my question is: If we publish the dashboard to inforview and save the scenario, the scenario will be saved in the BOE repositary or still on the local PC, and could the scenario be able to share among different users?
    Thanks a lot

  • AMD 3000+ cannot set the fsb in order to boot

    Hi,
    My system below worked fine with an AMD 2100 chip. I recently bought a 3000+ chip and slotted in to my PC - all booted up fine.  I then changed the FSB within bios to 166 - and then rebooted - the machine didn't boot and I had to clear the CMOS.
    I worked out that I cannot set the fsb to anything above 139 fsb else the machine won't boot and I have to reclear the CMOS...I have no idea what to do
    Anyone got any ideas pleaaaaseee?????
    btw I took the cpu down to the dealer and it worked fine there.
    AMD Barton 3000+ (333)
    2 x 256mb PC2700 ram
    MSI 4800 AGP 8X videocard
    Firewire Card
    DVD RW
    CD RW
    80 Gb HD
    120 GB HD
    PSU 350w - +3.3v / 28a
    +5v / 30a
    +12v / 15a

    Hi,
    Sorry my fault...
    but before I give you my system spec - I stuck in a 550W power supply and all is fine.
    However when I clock it up to 166 system crashes - better ram needed I guess.
    But FSb at 160 is fine....
    Considering its warm weather at the mo - my machie hits around 50 -55 degrees when playing something like fs2004.
    Thanks for your replies guys!
    M
    AMD Barton 3000+ (333)
    2 x 256mb PC2700 ram (non branded)
    MSI KTV4-L MB -
    MSI 4800 AGP 8X videocard
    Firewire Card
    DVD RW
    CD RW
    80 Gb HD
    120 GB HD
    PSU 350w - +3.3v / 28a
    +5v / 30a
    +12v / 15a

  • Cannot set the initial size of nested JFrame in NetBeans 5.5.

    For some background; I'm trying to design a small configurable, multi-market clock for Traders of foreign currency. Several international market times will be displayed and each will change color as that market opens and closes. The user will be able to select specific foreign markets and configure several options such as color and size.
    I was trying to use a JFrame for the initial window and an undecorated JFrame to hold the clocks and their labels. In the GUI builder for the initial JFrame, I dragged a JFrame and dropped it outside the original to add an (other Component). My problem is that I can't set the prefereedSize or the minimumSize properties for the nested JFrame. When I run the program, a button sets the second JFrame visible but at (0,0) size which when undecorated is invisible, and when decorated shows only the Min/Max/Close buttons. Am I just going about this all wrong or is this a bug
    I am running Java Version 1.5.0 (build 1.5.0_08-b03)
    Rick

    I have tried to use several different components but I have not been able to get them to appear as a component, undocked from the main window.
    Another idea that I tried was to have the whole program run from the same frame and then just set the window as undecorated and hide the menu bar. Unfortunately decorated state cannot be changed after it is displayable or packed. Besides that, how do you then make it moveable when there is no title bar? So many questions? Any other suggestions?

  • Cannot set the status CLSD

    We cannot assign the status Complete (business ) for some Refurbishment orders.
    We already run the settlement rule but we received the message below:
    "G/L account ABC requires a valid tax code". Please help......
    As I have not much dealt with this kind of issues, If feel there is some setting change in the taxcode.
    How do I check and compare the tax code and other related setting of this GL and the other..

    HI Ritu,
    Check transaction FS00 and maintain * in the Tax field for the G/L account XXXXXXXXX
    Execute FS00 transaction then Enter the G/L account & Company code. In Control data tab , change the Tax category to All tax types allowed or - Only input tax allowed based on your necessity
    Regards,
    Sanjeev

  • Cannot set the default value of an item in the detailed table

    Hi,
    I have Master-Detail group, both are Table formats.
    I need to set the default value of an item in the details row to the value of an item in the selected row in the Master table.
    I tried Default Display Value=#{row.MasterItem}, but it seems it is trying to access current details row instead of the Master.
    I tried #{bindings.MasterGroupColumnName.inputValue}, but it does not work.
    Any ideas
    Thanks in advance
    Mohamed

    I think I now what I'm doing differently, I had the "New Rows" JHS property of the detailed table group "empty" instead of the default "2" value.
    It seems that "Default Display Value" expression works only for the new records specified in the "New Rows" property. But when I try to "Add" new record using the "Add Row" button, the new record inserted does not have the default values generated, only has values populated for the items of the FK (in the view link) but not the ones set through the property.
    I guess in a nutshell, how I can get the details item to behave like the FK columns?
    Thanks much
    Mohamed

  • ListCellRenderer and JList... cannot set the selected background?

    The following code:
         public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus )
              setText( "test" );
              setBackground( isSelected ? list.getSelectionBackground() : list.getBackground() );
              setForeground( isSelected ? list.getSelectionForeground() : list.getForeground() );
              return this;
         }is having problems. It does not set the background color for the selected item. It does, however set the foreground. If I don't use my own cell renderer, the background changes as expected. I can't figure out why - I can set the border of the JLabel that is returned, the foreground, the icon, but not the background.
    What am I doing wrong?

    I would have to check, but from memory a cell is a JLabel not a JTextField. The diff is that a JLabel is transparent so the background colour is normaly that of the JPanel. In a JTable I presume the cell has some default background colour based on the table, so maybe you need to use a JTextField to define the field.
    Hope that helps,
    James.

  • HT1595 What do you do if the Apple TV cannot set the network time automatically?

    What do you do to set the network time so Apple TV can set up the Apple account?

    Hold down the shift key at reboot, see if that gets you in, if it does then start at #7
    "Gray Screen with spinning gear" type issues (can also be white or blue screen)
    Step by Step to fix your Mac

  • Cannot setting the BB to use the provider's 3G 2100 AIS ​​thailand.

    I setting the  apn to Enable and apn = internet   but can not use it.
    Please reply mail to <removed>
    MOD EDIT: Removed personal information to comply with Community Guidelines and Terms and Conditions of Use.

    Hi and Welcome to the Community!
    Please expand on your description...from "but can not use it", there's no way to understand what is happening. Please provide exact steps you attempt, along with the exact result of each step, and the exact and complete content of any error messages presented.
    Thanks and let us know!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • JPopupmenu - cannot set the title...

    Hai Friends,
    I couln't set the title for the jpopupmenu using the following....
    JPopupMenu menu = new JPopupMenu("My Title");
    Is there any other way... can anyone give me suggestions.....
    Regards,
    Ciya

    From the documentation:
    the string that a UI may use to display as a title for the popup menu.
    I've never seen a UI that actually uses this field. At least no default UI that comes with the JDK.

  • Cannot set the CPU's FSB clock to 133 anymore. What's wrong ?

    My AMD Athlon 2200+ processor runs now only on dafault value (100Mhz x 133 = 1350 MHz) instead of 1850 Mhz it just to run.
    If I change the values in Bios to what they used to be (133 x 13,5 = 1850 MHz) the computer blank, monitor is black and the PC doesn't response to power button. I can revive the PC by removing and replacing the motherboard's CMOS jumper, but the clock speed stays on that 'underclocked' value.
    Motherboard is MSI KT4V with 'Fuzzy Logic' -program. I've tried to set the FSB clock value back to normal (1850 Mhz) with this Fuzzy Logic by rising the value from 100 upwards, but when the program gets to somewhere around 110 Mhz the whole  system crashes. Windows's blue screen can be seen with the text 'Unexpected kernel trap'.
    So, something is wrong here, but I can not figure out by myself what it is. Can anyone help me ?

    Yes I agree with with Wonkanoby the power supply is the culprit as usual. The forum should have an opening page telling people to check their power supply is powerful enough before posting, the amount of power supply related problems I've read myself alone is massive.
    Get a nice 420 - 450W PSU with at least 24A on the +12V rail if not more. Tagan, Antec, Enermax and OCZ power supplies are the best brands.

  • Cannot Set the Deletion Flag on Order

    All the SAP Gurus,
    I am facing a problem when setting deletion flag for the Maintenance Order after I have Closed the Maintenance Order. It gives me the following error that the Purchase Order still exists that is why Deletion flag cannot be set on the Order. Now what should I do? How to delete the Purchase Order?
    Regards,
    Usman

    hi
    Since PO is already converted it is not possible to put the deletion flag unless all the services or material has been purchased.
    In the maintenance order try to delete the service or material ,which in turn deletion icon will  be set in the PR .
    then try to put the deletion flag for closed order
    regars
    thyagarajan

  • Cannot set the request filter to my JaxRsApplication

    I have my own jaxrs application which extend JaxRsApplication, and I try to add customized container request filter, but It cannot work. Could you please help me to find out my mistake?
    package com.octech.mamalianmeng.httpservice.application.base;
    import java.util.ArrayList;
    import java.util.List;
    import javax.ws.rs.core.Application;
    import org.eclipse.gyrex.context.IRuntimeContext;
    import org.eclipse.gyrex.http.jaxrs.JaxRsApplication;
    import com.sun.jersey.api.core.DefaultResourceConfig;
    import com.sun.jersey.api.core.ResourceConfig;
    import com.sun.jersey.spi.container.ContainerRequestFilter;
    import com.sun.jersey.spi.container.ContainerResponseFilter;
    public abstract class AbstractMumUnionJaxRsApplication extends JaxRsApplication {
    public AbstractMumUnionJaxRsApplication(String id, IRuntimeContext context) {
    super(id, context);
    protected Application createJaxRsApplication() {
    Application application = super.createJaxRsApplication();
    if (application.getClass().getName().equals(DefaultResourceConfig.class.getName())) {
    DefaultResourceConfig defaultResourceConfig = (DefaultResourceConfig) application;
    this.setContainerRequestFilters(defaultResourceConfig);
    this.setContainerResponseFilters(defaultResourceConfig);
    return defaultResourceConfig;
    } else {
    return application;
    * 设置请求过滤器
    * @param defaultResourceConfig
    private final void setContainerRequestFilters(DefaultResourceConfig defaultResourceConfig) {
    if (defaultResourceConfig == null) {
    return;
    List<Class<?>> containerFilters = this.getContainerRequestFilters();
    if (containerFilters != null && containerFilters.size() > 0) {
    List<String> filters = new ArrayList<String>();
    if (defaultResourceConfig.getProperties().containsKey(ResourceConfig.PROPERTY_CONTAINER_REQUEST_FILTERS)) {
    filters.add((String) defaultResourceConfig.getProperty(ResourceConfig.PROPERTY_CONTAINER_REQUEST_FILTERS));
    for (int i = 0; i < containerFilters.size(); i++) {
    if (ContainerRequestFilter.class.isAssignableFrom(containerFilters.get(i))) {
    filters.add(containerFilters.get(i).getName());
    defaultResourceConfig.getProperties().put(ResourceConfig.PROPERTY_CONTAINER_REQUEST_FILTERS, filters.toArray());
    * 设置相应过滤器
    * @param defaultResourceConfig
    private final void setContainerResponseFilters(DefaultResourceConfig defaultResourceConfig) {
    if (defaultResourceConfig == null) {
    return ;
    List<Class<?>> containerFilters = this.getContainerResponseFilters();
    if (containerFilters != null && containerFilters.size() > 0) {
    List<String> filters = new ArrayList<String>();
    if (defaultResourceConfig.getProperties().containsKey(ResourceConfig.PROPERTY_CONTAINER_RESPONSE_FILTERS)) {
    filters.add((String) defaultResourceConfig.getProperty(ResourceConfig.PROPERTY_CONTAINER_RESPONSE_FILTERS));
    for(int i = 0; i < containerFilters.size(); i++) {
    if (ContainerResponseFilter.class.isAssignableFrom(containerFilters.get(i))) {
    filters.add(containerFilters.get(i).getName());
    defaultResourceConfig.getProperties().put(ResourceConfig.PROPERTY_CONTAINER_RESPONSE_FILTERS, filters.toArray());
    * 返回请求过滤器的类数组,filter的执行顺序以加入list中的顺序为准
    * @return
    protected abstract List<Class<?>> getContainerRequestFilters();
    * 返回相应过滤器的类数组,filter的执行顺序以加入list中的顺序为准
    * @return
    protected abstract List<Class<?>> getContainerResponseFilters();
    package com.octech.mamalianmeng.httpservice.application;
    import java.util.ArrayList;
    import java.util.Collections;
    import java.util.HashSet;
    import java.util.List;
    import java.util.Set;
    import org.eclipse.gyrex.context.IRuntimeContext;
    import com.octech.mamalianmeng.httpservice.application.base.AbstractMumUnionJaxRsApplication;
    import com.octech.mamalianmeng.httpservice.application.filter.AuthorizationFilter;
    import com.octech.mamalianmeng.httpservice.resource.OrderServiceResource;
    public class DefaultMumUnionJaxRsApplication extends AbstractMumUnionJaxRsApplication {
    public DefaultMumUnionJaxRsApplication(String id, IRuntimeContext context) {
    super(id, context);
    @Override
    protected List<Class<?>> getContainerRequestFilters() {
    List<Class<?>> filters = new ArrayList<Class<?>>();
    filters.add(AuthorizationFilter.class);
    return filters;
    @Override
    protected List<Class<?>> getContainerResponseFilters() {
    return Collections.emptyList();
    @Override
    protected Set<Class<?>> getJaxRsClasses() {
    Set<Class<?>> classes = new HashSet<Class<?>>();
    classes.add(OrderServiceResource.class);
    return classes;

    Hi,
    I had the same issue.
    My soltion was
    public class JaxRsAppExt extends JaxRsApplication {
    private ContextServiceInjectableProvider contextServiceInjector;
    private InjectServiceInjectableProvider injectServiceInjector;
    private final Bundle bundle;
    public JaxRsAppExt(final String id, final IRuntimeContext context, final Bundle bundle) {
    super(id, context);
    this.bundle = bundle;
    @SuppressWarnings("unchecked")
    @Override
    protected Application createJaxRsApplication() {
    final Application app = super.createJaxRsApplication();
    if (null != this.contextServiceInjector) {
    app.getSingletons().add(this.contextServiceInjector);
    if (null != this.injectServiceInjector) {
    app.getSingletons().add(this.injectServiceInjector);
    ((ResourceConfig) app).getContainerRequestFilters().add(0, APIAuthFilter.class);
    ((ResourceConfig) app).getContainerResponseFilters().add(0, APIAuthFilter.class);
    ((ResourceConfig) app).getResourceFilterFactories().add(0, RolesAllowedResourceFilterFactory.class);
    return app;
    @Override
    protected void doDestroy() {
    try {
    // call super
    super.doDestroy();
    } finally {
    if (null != this.contextServiceInjector) {
    this.contextServiceInjector.dispose();
    this.contextServiceInjector = null;
    if (null != this.injectServiceInjector) {
    this.injectServiceInjector.dispose();
    this.injectServiceInjector = null;
    @Override
    protected void doInit() throws IllegalStateException, Exception {
    // create service injector
    this.contextServiceInjector = new ContextServiceInjectableProvider(this.bundle.getBundleContext());
    this.injectServiceInjector = new InjectServiceInjectableProvider(this.bundle.getBundleContext());
    // call super
    super.doInit();
    @Override
    protected Set<Class<?>> getJaxRsClasses() {
    return new BundleScanningResourceConfig(this.bundle).getClasses();
    Then you adding over porperties ir

Maybe you are looking for

  • Accidental deletion of data in contacts application file

    While trying to follow instructions from an application web site to correct doubled listing in my contact file, I accidentally deleted the date in the contacts file under applications rather than the contact storage file.  (settings/applications/mana

  • Windows Vista User upgraded to iTunes 7.7 and now MPEG-4 videos won't play

    I'm a windows vista user, and I just updated to iTunes 7.7 with Quicktime. Prior to the update all my videos & related codecs files worked just fine(e.g., MPEG-4 and H.264 codecs). However, since the Quicktime & iTunes 7.7 update, now only videos cod

  • Java script not working in 1 pdf, but same script is NOT working in other

    Dear Experts, I have a problem with java script. I have created 2 PDFs with the same Form name and sub form names. I have written a javascript and this script seems to be working in one (Demand2.pdf) and NOT working in the other (Sample.pdf). The lin

  • Changing an Object in the Universe - does this auto show in the document??

    Hello I have to make some changes to some Dimension and Detail objects in my Universe as some of the underlying data is changing and so case statements that I have in my objects will need to change. For example, say I have an object called "Colour De

  • How necessary is Java?

    Doing a fresh install of Mac OS X 10.4.11, I realized that the Java updates -- seven of them, which must be tediously installed one by one in order -- are more than all the other 10.4 updates combined: 432MB (Java) vs. 386MB (10.4.11 Combo, QuickTime