Hello Jordan,
(Repost from Dan Korn)
Editing the installed .js files, including Builtins.js,
BuildingBlocks.js, and the various RuleTemplates.<language>.js files, is
unsupported and discouraged.
If you want your own custom JavaScript localized to your machine, you
are encouraged add your own .js files in the Plug-ins folder. If you
want custom JavaScript logic to be attached to a particular job, you are
encouraged to use the JavaScript Globals dialog. If you want to share
JavaScript logic between jobs, you can use the Load function to process
a .js file from a shared network location.
Again, editing the RuleTemplates files is not supported, and if you
choose to do so, it's at your own risk. I can't stress this enough.
...
Okay, that said, if you choose to edit the RuleTemplates files anyway,
you have to remember that the syntax properties in those .js files are
merely strings, which are interpreted by JavaScript to obtain the actual
rule syntax, which itself will be interpreted in the Rule Editor. In
other words, there's an extra level of parsing, or indirection.
For instance, "Salutation" rule looks like this in the
RuleTemplates.English.js file:
FusionPro.RuleTemplates["Salutation"] =
{
description:
"Returns \"Mr. \", \"Ms. \", or an empty string, " +
"depending on the value of the \"gender\" field.",
syntax:
"// Change field name to match your data.\n" +
"switch (Field(\"gender\").toUpperCase()[0]) \n" +
"{\n" +
" case \"M\": return \"Mr. \";\n" +
" case \"F\": return \"Ms. \";\n" +
" default : return \"\";\n" +
"}\n",
istext:1,
isgraphic:0
}
This entire statement is a property called Salutation on the
FusionPro.RuleTemplates object. This property is itself an object, and
it has properties called description, syntax, istext, and isgraphic.
The syntax property is a string. When this string is parsed, it becomes
the following, as seen in the Rule Editor when you select the template
in the New Rule dialog:
// Change field name to match your data.
switch (Field("gender").toUpperCase()[0])
{
case "M": return "Mr. ";
case "F": return "Ms. ";
default : return "";
}
You should be able to compare the two and see how this works. Note
especially how the quotes in the resulting rule are escaped in the
RuleTemplates syntax.
-Alex
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 11, 2008 5:53 PM
To: FusionPro Users Forum
Subject: [fusionpro] Save Rules I've made
Is there any way to save the rules i make so i can use them on future
documents? I want to be able to set it all up on one job. Then when i get
another job down the road i don't want to spend a lot of time writing out
each rule. I know the field titles might change a bit but i don't think it
would takee long to change out just the field titles.
-Jordan Hickok
Auburn Printers.com
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
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
--
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
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
--