News:

Main Menu

Fusion Pro VDP job

Started by DigiCorn, September 04, 2013, 12:37:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DigiCorn

I have a variable text field that has either 2 or 3 horizontal lines of text. They are divided vertically by a green graphic image. When there are only 2 lines of text, I need a portion of the green line covered up. I created a white box graphic and added it to the resources. Then I wrote this script:

Quoteif (Field("Direct") == "", Field("Cell") == "") return Resource("Resource1");
else return NullResource();

If both "Direct" and "Cell" are empty fields, the white box appears, which is what I want. If "Cell" exists, then the white box goes away, also what I want. But if "Direct" exists, the white box appears, which I do not want.

I thought it might be something simple, like add a line like this:
Quoteif (Field("Direct") !="") return NullResource();

but it doesn't work. I do not know JavaScript so I am confused.
"There's been a lot of research recently on how hard it is to dislodge an impression once it's been implanted in someone's mind. (This is why political attack ads don't have to be true to be effective. The other side can point out their inaccuracies, but the voter's mind privileges the memory of the original accusation, which was juicier than any counterargument ever could be.)"
― Johnny Carson

"Selling my soul would be a lot easier if I could just find it."
– Nikki Sixx

"Always do sober what you said you'd do drunk. That will teach you to keep your mouth shut."
― Ernest Hemingway

t-pat

I don't know javascript well enough either but I can tell you that it seems like your logic is based on both conditions being true, not a one OR the other. Try moving the brackets around to nest the expressions so they're explicit, or simply add 2 conditions, not both in the same expression.

My syntax is probably fucked but something like this.

if (Field("Direct") == "" return Resource("Resource1")
else if
Field("Cell") == "") return Resource("Resource1");
else return NullResource();
vdp donkey
gmc inspire • sarcasm while you wait

DigiCorn

#2
hmmm... in theory yours is correct, just like mine... but still not working...

[edit]My bad... this converse statement works.

Quoteif (Field("Direct") != "" || Field("Cell") != "") return NullResource();
else return Resource("Resource1");
"There's been a lot of research recently on how hard it is to dislodge an impression once it's been implanted in someone's mind. (This is why political attack ads don't have to be true to be effective. The other side can point out their inaccuracies, but the voter's mind privileges the memory of the original accusation, which was juicier than any counterargument ever could be.)"
― Johnny Carson

"Selling my soul would be a lot easier if I could just find it."
– Nikki Sixx

"Always do sober what you said you'd do drunk. That will teach you to keep your mouth shut."
― Ernest Hemingway

t-pat

Quote from: DigiCorn on September 04, 2013, 02:07:05 PMhmmm... in theory yours is correct, just like mine... but still not working...

I find with this stuff, you need to explicitly define the condition and result, trying to make combined statements does weird shit or no shit.

Cover each individual scenario, with it's result, in individual explicit statements, I'm not good enough at the raw scripting to be super confident in the results if I try to make complex statements.

It's surely the fault of a misplaced ")"
vdp donkey
gmc inspire • sarcasm while you wait

DigiCorn

Just perusing the FP forums earlier today. That Dan Korn is a real dick, man.

Quote
Quote from: Originally Posted by kenstraker  Thanks for you swift response, i am not sure what i am doing wrong,but when i use the rule
i get line 2: typeError: items.filter is not a function
What am i missing?
Quote from: Dan KornThat's because you're using a version of FusionPro older than 8.0. I would have known this if either (a) you specified the version you're using in your post, or in your signature or (b) my ESP was working. See my signature below for recommendations on how to be specific about the versions of things you're using in order to get better answers to your questions.
"There's been a lot of research recently on how hard it is to dislodge an impression once it's been implanted in someone's mind. (This is why political attack ads don't have to be true to be effective. The other side can point out their inaccuracies, but the voter's mind privileges the memory of the original accusation, which was juicier than any counterargument ever could be.)"
― Johnny Carson

"Selling my soul would be a lot easier if I could just find it."
– Nikki Sixx

"Always do sober what you said you'd do drunk. That will teach you to keep your mouth shut."
― Ernest Hemingway

gnubler

He's a real prick.  :laugh:  Someone post a dump of his sig again, it's so anal it's DVDA.
Hicks • Cross • Carlin • Kinison • Parker • Stone •  Colbert • Hedberg • Stanhope • Burr

"As much as I'd like your guns I prefer your buns." - The G

Quote from: pspdfppdfx on December 06, 2012, 05:03:51 PM
So,  :drunk3: i send the job to the rip with live transparecy (v 1.7 or whatever) and it craps out with a memory error.

Member #14 • Size 5 • PH8 Unit 7 • Paranoid Misanthropic Doomsayer • Printing & Drinking Since 1998 • doomed ©2011 david

Joe

So Corn don't like Korn?

Weird...
Mac OS Sonoma 14.2.1 (c) | (retired)

The seven ages of man: spills, drills, thrills, bills, ills, pills and wills.

gnubler

Korn makes our Corn look like jesus or something.
Hicks • Cross • Carlin • Kinison • Parker • Stone •  Colbert • Hedberg • Stanhope • Burr

"As much as I'd like your guns I prefer your buns." - The G

Quote from: pspdfppdfx on December 06, 2012, 05:03:51 PM
So,  :drunk3: i send the job to the rip with live transparecy (v 1.7 or whatever) and it craps out with a memory error.

Member #14 • Size 5 • PH8 Unit 7 • Paranoid Misanthropic Doomsayer • Printing & Drinking Since 1998 • doomed ©2011 david

DigiCorn

Quote from: gnubler on September 04, 2013, 04:20:41 PMHe's a real prick.  :laugh:  Someone post a dump of his sig again, it's so anal it's DVDA.

Quote__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable Technologies

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@pti.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@PTI.com. Paid consulting work may be required to fulfill your template-building needs.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to MarcomCentral in the MarcomCentral forum. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
"There's been a lot of research recently on how hard it is to dislodge an impression once it's been implanted in someone's mind. (This is why political attack ads don't have to be true to be effective. The other side can point out their inaccuracies, but the voter's mind privileges the memory of the original accusation, which was juicier than any counterargument ever could be.)"
― Johnny Carson

"Selling my soul would be a lot easier if I could just find it."
– Nikki Sixx

"Always do sober what you said you'd do drunk. That will teach you to keep your mouth shut."
― Ernest Hemingway

DigiCorn

Quote from: gnubler on September 04, 2013, 04:20:41 PMHe's a real prick.  :laugh:  Someone post a dump of his sig again, it's so anal it's DVDA.
The owner here called him one time when I was out. I guess he really mouthed off to the owner, and the owner here really got into a pretty serious argument, in which they traded mother insults (yo momma so fat, she walked in front of the tv and I missed three episodes). When I got back, he asked me if I knew that guy, and I said, "not personally."
"There's been a lot of research recently on how hard it is to dislodge an impression once it's been implanted in someone's mind. (This is why political attack ads don't have to be true to be effective. The other side can point out their inaccuracies, but the voter's mind privileges the memory of the original accusation, which was juicier than any counterargument ever could be.)"
― Johnny Carson

"Selling my soul would be a lot easier if I could just find it."
– Nikki Sixx

"Always do sober what you said you'd do drunk. That will teach you to keep your mouth shut."
― Ernest Hemingway

gnubler

Like, who the fuck would sign up at a forum for what might be a one-time thing and immediately fill their sig with all that info? Screw him.
Hicks • Cross • Carlin • Kinison • Parker • Stone •  Colbert • Hedberg • Stanhope • Burr

"As much as I'd like your guns I prefer your buns." - The G

Quote from: pspdfppdfx on December 06, 2012, 05:03:51 PM
So,  :drunk3: i send the job to the rip with live transparecy (v 1.7 or whatever) and it craps out with a memory error.

Member #14 • Size 5 • PH8 Unit 7 • Paranoid Misanthropic Doomsayer • Printing & Drinking Since 1998 • doomed ©2011 david

t-pat

I like the GMC forums better, the mods are the developers, and they're mostly Czech guys with good manners.
vdp donkey
gmc inspire • sarcasm while you wait

DigiCorn

Do they talk about Fusion Pro over there? I don't know Javascript, so I only log into Printables to find help steal a script I can modify.
"There's been a lot of research recently on how hard it is to dislodge an impression once it's been implanted in someone's mind. (This is why political attack ads don't have to be true to be effective. The other side can point out their inaccuracies, but the voter's mind privileges the memory of the original accusation, which was juicier than any counterargument ever could be.)"
― Johnny Carson

"Selling my soul would be a lot easier if I could just find it."
– Nikki Sixx

"Always do sober what you said you'd do drunk. That will teach you to keep your mouth shut."
― Ernest Hemingway

t-pat

Quote from: DigiCorn on September 05, 2013, 10:38:40 AMDo they talk about Fusion Pro over there? I don't know Javascript, so I only log into Printables to find help steal a script I can modify.

nope, they don't talk about anything but their software, and unfortunately for you the scripting is C++. To do what you're looking for requires no scripting.

It would be something like this:
vdp donkey
gmc inspire • sarcasm while you wait

DigiCorn

I don't want to bother Dan Korn with a simple request, but I've searched the forums at PTI and re-read the manual and I can't find a walkthrough on how to place an inline graphic into a VDP box. Do any FP users out there know how to do this?
"There's been a lot of research recently on how hard it is to dislodge an impression once it's been implanted in someone's mind. (This is why political attack ads don't have to be true to be effective. The other side can point out their inaccuracies, but the voter's mind privileges the memory of the original accusation, which was juicier than any counterargument ever could be.)"
― Johnny Carson

"Selling my soul would be a lot easier if I could just find it."
– Nikki Sixx

"Always do sober what you said you'd do drunk. That will teach you to keep your mouth shut."
― Ernest Hemingway