Hi Nicola,
It would help to have an idea of the larger issue you're trying to solve
with this multi-frame layout, because there might be a simpler way to
accomplish it. I'm also a bit confused as to whether you're talking
about text or graphic frames. (You wrote "graphic" in the subject but
in the message you said, "I have a template that has several variable
text frames".) Anyway, I'm assuming you mean text frames.
That said, yes, it's possible, but not all in one rule. You're still
going to need four rules, one for each frame. But the logic to
determine how many fields contain a value can be put in a common
function in your JavaScript Globals, so the logic for each rule
shouldn't be too complicated.
For instance, you can have some functions like this in your JavaScript
Globals:
function NumNonEmptyFields()
{
var count = 0;
for (var i = 0; i < arguments.length; i++)
{
try
{
if (Field(arguments[i]))
count++;
}
catch (e)
{
Print(e);
}
}
return count;
}
function MyNonEmptyFields()
{
// Use your own field names here...
return NumNonEmptyFields("Home", "Fax", "Cell", "Office");
}
function MyOutput()
{
// Whatever you want the output to be....
return "here's the output";
// Maybe return a Formatted Text Resource?
//return Resource("MyResource");
}
The rule for frame "A" would look something like this:
if (MyNonEmptyFields() == 4)
return MyOutput();
//else
return "";
And the rule for frame "B" would look something like this
if (MyNonEmptyFields() == 3)
return MyOutput();
//else
return "";
And so on. This can be generalized further as well, by making a
function that takes the number (1, 2, 3, or 4) as a parameter:
function OutputForNumFields(numFields)
{
if (numFields == MyNonEmptyFields())
return MyOutput();
//else
return "";
}
In which case the rule for frame "A" would just be:
return OutputForNumFields(4);
And so on.
Of course, I have no idea what the actual text should be if you're
"using" the frame. That's why I suggested you might want to use a
Formatted Text Resource in the comment, since you can format it just
like you were in the Text Editor for the frame itself, using the
Suppress if Empty (or Suppress if Containing Empty Variables) feature to
only show lines for the non-empty fields.
If you're using graphic frames, then it's just a matter of doing
something like this:
if (MyNonEmptyFields() == 4)
return Resource("MyResource");
//else
return NullResource();
Actually, that same syntax would work for a text rule, if you're
returning a text resource.
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
--