MSilber Posted June 30, 2014 Share Posted June 30, 2014 Hi, I want to use the value of FusionPro.Composition.JobOptions.UseImpositionDefFile which is Yes or No in a rule, but I cannot get this working. In case I just return the value in a text frame it shows either Yes or No, but in case I use an if statement like if (FusionPro.Composition.JobOptions.UseImpositionDefFile = "Yes") { return "Imposition"; } else { return "noImposition"; } I always get back "Imposition". Any idea what I'm doing wrong? I also tried to set a global variable with an OnJobstart callback rule but also with no success. Maybe it is just an obvious mistake. btw: There is no whitespace in the JobOptions value between Def and File Thanks! Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted June 30, 2014 Share Posted June 30, 2014 Hi, I want to use the value of FusionPro.Composition.JobOptions.UseImpositionDefFile which is Yes or No in a rule, but I cannot get this working. In case I just return the value in a text frame it shows either Yes or No, but in case I use an if statement like if (FusionPro.Composition.JobOptions.UseImpositionDefFile = "Yes") { return "Imposition"; } else { return "noImposition"; } I always get back "Imposition". Any idea what I'm doing wrong? The comparison operator in JavaScript is == (two equal signs, not one). The single equal sign = is for assignment. So the first line of your rule should be this: if (FusionPro.Composition.JobOptions.UseImpositionDefFile [color="SeaGreen"]==[/color] "Yes") I also tried to set a global variable with an OnJobstart callback rule but also with no success. I don't understand what you mean here. btw: There is no whitespace in the JobOptions value between Def and File Instead of simply copying the code into the forum here and changing the font, you should click the "Go Advanced" button, then use the # button to place your code into a Code block. Quote Link to comment Share on other sites More sharing options...
MSilber Posted June 30, 2014 Author Share Posted June 30, 2014 Hi Dan, thanks a lot. with "==" it works, not sure why I made this small mistake. Next time I will use the # for my code block. Marcus Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.