Jump to content

ScottHillock

Registered Users - Approved
  • Posts

    96
  • Joined

Everything posted by ScottHillock

  1. I don't think dropbox is going to support that. If you could get a url for each file you would be in a better situation. But only having a url to a folder isn't going to help. To isolate the issue try your url with curl. curl -O https://fulldropboxlinktofile
  2. Use lower case names for your FusionPro pdf. Instead of "MyFusionProSetupFile.pdf" use "myfusionprosetupfile.pdf".
  3. Create a new rule and return FusionPro.Composition.outputFileName
  4. Can you just create a text frame and fill with graphic images? var images = []; for (i = 1; i <= 6; i++){ if (Field("XSell" + i)){ images.push('<graphic file="./XSell' + i + '.pdf">'); } } return images.join('<br>');
  5. I would suggest this: var email = 'first.middle.last@whatever.com'; if (!email){return "";} //remove all text after @ symbol, then split into an array based on periods names = email.replace(/@.*/, '').split('.'); //replace first letter with upper, and concat with the rest of the string for (i = 0; i < names.length; i++){ names[i] = ToUpper(names[i][0]) + names[i].substring(1); } //join back names with a period separator and add domain return names.join('.') + "@CassiaLife.org"; You could also do the following: var email = 'first.middle.last@whatever.com'; if (!email){return "";} return email.replace(/@.*/, '').replace(/(^|[.]+)([a-z])/g, function (m, $1, $2) { return $1 + $2.toUpperCase(); }) + "@CassiaLife.org"; But, it's harder to adjust in case you wanted to make the names proper case, or remove spaces, etc.
  6. I don't have any experience with Producer. I assumed we were talking about Creator. The path name is going to be different than if it were on a Mac. I believe you'll need to have the share mapped to a drive and use "Z:\\ABOTA\\" I'm sure there's some other way with string replacement to always get the jobs to go to your intended folder, but I don't have access to the documentation. This might be a case where you need to contact support.
  7. Looks like the actual path you need is /Volumes/Jobs/ABOTA/ The smb://... is just the server address and not it's location in relation to the filesystem. FusionPro.Composition.outputFileFullPathName expects a full path and file name. And FusionPro.Composition.OpenNewOutputFile will output a file in the destination folder from the composition settings. I'm not too sure if these can be mixed. Dan Korn might be able to give more information. Unless you're specifically trying to move different PDFs to different folders I'm not sure why you're trying this method though. Couldn't you just do the OpenNewOutputFile and point your composition output to the folder you want? Edit: Looks like you could just do: if (FieldChanged("Member No")){ FusionPro.Composition.OpenNewOutputFile("/Volumes/Jobs/ABOTA/" + Field("Member No") + "." + FusionPro.Composition.outputFormatExtension); }
  8. Couple of things. First when making a post with code use the advanced editor, or use this: [code] --- Code goes here --- [/code] Second, does that path "/Volumes/smb/192.168.200.72/Jobs/ABOTA/" even exist? If you open Finder and from the menu bar choose Go > Go to Folder... and then paste that in does it take you to the folder you're expecting?
  9. On your VARIABLE8 you're missing the Field part. Also, I'm not sure if it might have slipped your mind, but in your if statement there needs to be a condition on each pair. So, just having the == "" on the last pair doesn't apply to all of them. But, if you're just looking to see if the field contains anything then you're ok, unless those fields might include a 0. Also, it's composeThisRecord and not ComposeThisRecord. You don't really need the else statement either. Might also just be personal preference, but I'm not a fan of the multiple if checks. But, here is how I would do it. var arr = [ Field("VARIABLE1"), Field("VARIABLE2"), Field("VARIABLE3"), Field("VARIABLE4"), Field("VARIABLE5"), Field("VARIABLE6"), Field("VARIABLE7"), Field("VARIABLE8"), Field("VARIABLE9"), Field("VARIABLE10"), Field("VARIABLE11"), Field("VARIABLE12"), Field("VARIABLE13"), Field("VARIABLE14") ]; var combined = arr.filter(String).join(""); if(combined === ""){ FusionPro.Composition.composeThisRecord = false; }
  10. I believe you have the order of your parameters switched on your percentage example. With replace the first parameter is what you are searching for, and the second is what to replace it with. Here's a bit of code that covers both $ and %: var fieldName = Field("field"); var field = fieldName.replace(/\$/g,'').replace(/\%/g,''); if(fieldName.indexOf('$') > -1){return '$' + field;} if(fieldName.indexOf('%') > -1){return field + '%';} return field;
  11. Dan, sample files attached. Unchecking the Limit processing to.. checkbox does make the notdef character not appear. And it's a viable solution. But, I usually leave that checked to make sure the data source doesn't contain characters that might cause issues on output. But, I should probably move that "checking" to a different workflow process. We do have FusionPro 9, so the <hkeep> and AddTextReplacement aren't available to us to use yet, but we're looking at the upgrade to 10 in the near future. Archive.zip
  12. Excellent Dan, thank you. I'll keep in mind the <hkeep> tags when I need them. The character accidentally shows up sometimes in FusionPro text frames when the InDesign source document has returns with a normal space on an empty line. So ^p ^p ends up turning into ^p ^p. I have a few InDesign scripts to clean things up for FusionPro but on some documents we can't run the scripts, so I was looking for an automated solution to fix the notdef character from basically ever showing up in a document with a character.
  13. Add this as your first line: if (!Field("GIFT_DATE")){return "";}
  14. I'm looking to create a rule that will replace all occurrences of a string of text, even when that text is not part of a rule. Specifically we're having an issue where the notdef symbol is being inserted when some fonts don't have the character. I'd like to replace the font for this character to one which does have the glyph defined. I know how to make this change when the text is returned from a rule. I'm just looking for the FusionPro way of searching through all text frames and replacing characters.
  15. I don't believe this is possible. FusionPro composes in the order of the input Data Source, and I don't believe there is a way to seek around that data source.
  16. Replacing the repetition of it with a loop, and a join. var Strline = []; for (i=1; i <= 16; i++){ Strline[i] = (!Field("series_" + i)) ?" ": Trim(Field("series_" + i) + "<br>"); } return Strline.join(""); Replacing even more with a filter and adjusting the join. var Strline = []; for (i=1; i <= 16; i++){ Strline[i] = Trim(Field("series_" + i)); } return Strline.filter(String).join("<br>"); I'm sure there's ways to make it even simpler. But, I tend to leave code a little more verbose.
  17. I think you're trying to use repeatable templates. Which might be beneficial in this project, but I would do them in reverse, with the address block being the repeatable template, and create a new page for each version of the postcard. Simply add pages and name them the version code, and set the page to unused. Create a OnRecordStart rule to activate the necessary page FusionPro.Composition.SetBodyPageUsage(Field("TEMPLATENAME"), true); Create a new template page with the Addressing information, and return it with a text rule return new FPRepeatableComponent('address'); See attached modified PDF. If you wanted to keep down on your way you could just modify the "addressBlockAndIndicia" rule to your liking to return the template page you need. Postcard PreSort Mktg test.pdf.zip
  18. Randy, we are on Mojave 10.14.1, Acrobat 11, InDesign 2015 for template creation, and FusionPro 9.3.36 and have no issues.
  19. Can you post the files? It's probably some error in your OnRecordStart.
  20. Sorry about that, I forgot one more rule. Add this to an OnRecordEnd rule: gCount = gCount + StringToNumber(Field("Count"));
  21. In JavaScript Globals add var gCount = 1; Change your rule to: var result = []; var r = CreateResource("test.pdf", "graphic"); var count = StringToNumber((Field("Count"))); var record = CurrentRecordNumber(); for (var p = gCount; p < count + gCount; p++) { r.pagenumber = p; result.push(r.content); } return result.join("<br>\n"); OnRecordEnd Rule gCount = gCount + StringToNumber(Field("Count")); If you need to start at a different page number in the source PDF than 1, just change the value in the javascript globals. Also, in the files you uploaded you'll need to assign the second page the type of "Overflow" in Page Usage.
  22. Those are missing glyph symbols. It's a result of the character and whichever font you have assigned to the text not having a glyph specifically for it, I believe. if you change your return to something like this it should remove the boxes. return result.replace(" ","<f name=‘Helvetica’> </f>"); Why does it preview and compose differently? I'm not sure. I always thought the preview was just a compose and convert to image happening in the background. But, I'm guessing there's a slightly different path happening which leads to the inconsistency.
  23. I have not used Marcom, but to answer the first part of your question, this will work: var RecordLimit = 20; if (FusionPro.Composition.inputRecordNumber > RecordLimit){FusionPro.Composition.composeThisRecord = false;}
  24. Double check that the frame in InDesign is a graphic frame (Object > Content > Graphic).
  25. This will work i think: for (i=1; i<=4; i++){FusionPro.Composition.SetBodyPageUsage(i, false);} FusionPro.Composition.repeatRecordCount = Field("Output"); var pageToCompose = FusionPro.Composition.repeatRecordNumber % 4; if (!pageToCompose){pageToCompose = 4;} FusionPro.Composition.SetBodyPageUsage(pageToCompose, true); FusionPro.Composition.AddVariable("iteration", Math.floor(((FusionPro.Composition.repeatRecordNumber - 1) / 4) + 1)); This will also give you a variable you can insert for the iteration number.
×
×
  • Create New...