On Jun 17, 2008, at 2:37 PM, Dan Korn wrote:
Do you have a "return" statement preceding that last line?

On Jun 17, 2008, at 3:04 PM, Jon Molesa wrote:
No.


Yes, you do!  There are two, at lines 15 and 20.

Looking at your rule a bit more closely, I suspect that the problem is in this part:

   try
   {
     if (of.open("create") == false)
     {
       return "Could not write output file:\n" + temp;
     }
   }
   catch (e)
   {
     return e + ":\n" + temp;
   }

You're probably hitting one of those "return" lines, which is short- circuiting the rule before it gets to the end. Try doing this instead:

   try
   {
     if (of.open("create") == false)
     {
       Print("Could not write output file:\n" + temp);
     }
   }
   catch (e)
   {
     Print(e + ":\n" + temp);
   }

I'll bet that you see one of those messages in the log file.

In fact, these "return" statements must be the cause of the problem, because if you replaced the entire syntax of the rule with this (or put it at the start):

Print("Hi Jon, this is your input file: " + FusionPro.Composition.inputFileName);

Then you would surely see the message in your log file. The fact that you're not seeing the message from the Print function call at the end means that that line is not being executed, which can only happen for one of three reasons: you throw an exception, you hit a return statement before reaching that line, or the line is conditionalized out (such as in an "if" statement block).

Unfortunately, as the message box notes when you're in a Callback rule and click Validate, the return value is ignored at composition time. However, the effect of the "return" statement itself, in terms of short-circuiting the rule's execution, is still present. So the entire rule is silently failing with a "return" statement.

Those other calls to "print" in the sample rule are typos: the function name is "Print", and variable names in JavaScript are indeed case-sensitive.

Dan


+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
FusionPro 5.0 Now Available!


Variable text on a curve and soft drop-shadows for variable text


LIMITED TIME upgrade offer of $299 per license for current customers:
http://fusionpro.printable.com/store/upgrade

New licenses available for $599 each at:
http://fusionpro.printable.com/store/

All FusionPro 5.0 customers to receive FusionPro 5.1 with
Adobe Acrobat 8 and InDesign CS3 support when released for FREE.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
--
Users of FusionPro Desktop have unlimited free email support. Contact Printable Support at [EMAIL PROTECTED] --
View FusionPro Knowledge Base, FusionPro Samples at
www.printable.com/vdp/desktop.htm

--
You are currently subscribed to fusionpro as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
--


--
Note:  All e-mail sent to or from this address will be received or otherwise 
recorded by the e-mail recipients of this forum. It is subject to archival, 
monitoring or review by, and/or disclosure to someone other than the recipient. 
Our privacy policy is posted on www.printplanet.com
--

Reply via email to