Jump to content

save rule


billn

Recommended Posts

You can import your rules from a pre-existing .dif file. You can also create a text file with custom JavaScript functions and place the .js file in /Library/Application Support/Printable/FusionPro/Plug-Ins (Mac) which will allow you to call the repetitive task from any new template.
Link to comment
Share on other sites

I was wondering about this as well, but I can't seem to get it to work. Is there a certain format the rule needs to be in? I copied it into a plain text file and saved it with a .js extension, placed it where Eric said and I can't seem to import it into FP. Should it appear in the list when I choose New Rule?
Link to comment
Share on other sites

I am attaching a zipped file for a sample .js file that I keep in my Plug_ins folder. Once the file is placed there and FP is restarted, the functions should appear in the Building Blocks palette, under the Functions tab, in the (Global) set. You would use the custom function in a rule such as:

return superScript(Field("your_field"));

custom_rules.js.zip

Link to comment
Share on other sites

Thanks, Eric. When I put yours in the plug-ins folder it works, but when I put mine in FP tells me it can't compile. All I did was take an existing rule from a live job (so I know the rule works), copy and paste it into a plain text file, save as .txt and then change the extension to .js. Obviously I'm doing something wrong.

 

You also mentioned that one can import rules from a pre-existing .dif file. I can't figure that one out, either. Could you shed some light on how to import the .dif?

 

Today I had 6 different jobs that have the same variable info and rules (4 rules total) but just a different static background. It was quite a chore to transfer the rules one at a time (I copied them into a text file so I could more easily copy and paste each one). While I didn't have to retype each rule, it was still a cumbersome process to create 4 rules in each of 6 documents. If I could simply import the rules life will be easier, especially since this will be an ongoing project for me.

 

Thanks for all your help, Eric. I always learn something from your posts.

Link to comment
Share on other sites

Thanks, Eric. When I put yours in the plug-ins folder it works, but when I put mine in FP tells me it can't compile. All I did was take an existing rule from a live job (so I know the rule works), copy and paste it into a plain text file, save as .txt and then change the extension to .js. Obviously I'm doing something wrong.

The .js script files that you put in the Plug-Ins folder contain functions which you can call from rules in any job on the machine, but they do not actual rules themselves. Take a closer look at what Eric posted; he even said, "You would use the custom function in a rule such as" and an example. You need to take the logic from one of your rules and put it into a function, with the function keyword, as in the example that Eric posted or as in the example in the section titled "Functions" in the FusionPro Rules System Guide (page 41 in my version). The function will then appear in a custom node in the tree on the Functions tab of the Building Blocks dialog, from whence you can click the Insert button to place the default syntax into your JavaScript rule.

You also mentioned that one can import rules from a pre-existing .dif file. I can't figure that one out, either. Could you shed some light on how to import the .dif?

You import rules from a pre-existing .def (Data Source Definition) file, not from a .dif (format/layout) file. From the menu in Acrobat, select FusionPro -> Data Definition-> Wizard (or click the "orange F" button on the FusionPro toolbar or Steps palette), click the "Import a data source from another document" radio button and then click "Next" and browse to the .def file. You may need to go back and re-select your input data file if the .def file from which you're importing settings uses a different input file or data source.

Link to comment
Share on other sites

Thanks for the insight, Dan. I'll experiment with those options when I have some time.

 

I hope that future versions of FP become more user-friendly for average users! A simple "Import/Export Rules" option in the Edit Rules window would greatly ease the pain, and allow users to more easily reuse rules that we build. HP's SmartStream (formerly YoursTruly) has this feature and it is quite handy.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...