noellefoto Posted March 13, 2008 Share Posted March 13, 2008 It would be great if someone could help me with this label generator script. I got it from Comment's post at this link http://www.fmforums.com/forum/showpost.php?post/203220/ I'm working with Filemaker 8.5 on a Mac. I imported and adjusted the script from the sample file mentioned above, and I got it working. But the next time I went to use the script (after a few weeks) it didn't work. So I thought something was wrong and I imported it again, adjusted it to my needs again, and it worked again. And now, after a few months, I need to print more labels, and it doesn't work!! Here's a copy of my adjusted script. Custom Dialog: Set SkipNumber, Set LabelQty Set Variable $ProductID Enter Find Mode - Set Field Products::ProductID; $Product ID - Perform Find * I do this to isolate the record as I only want to print labels for one product with this script. I have another script which does a Find [Restore] so I can print labels for multiple products. * Go to New Table - Labels Show All Records Delete All Records Loop Exit Loop if [Get (FoundCount) >= SkipNumber New Record/Request End Loop Import Records from file; Add; Mac Roman Products::ProductID to Labels::ProductID Show all records Right now it takes me to the label layout and then stops, not importing or duplicating anything. If I go back to the script and create the Import step again so it's exactly the same (not duplicating it but building that step from scratch) and delete the previous Import step it does import ONE record and skip the appropriate number of labels, but it doesn't duplicate it for the Label Quantity. I realize that when I go to Comment's demo, there is a "Import Options" dialog that pops up when I hit ok in the "Import Field Mapping" screen under the import records step that asks if the records should be split into separate records, which I know is the missing element to my scripts and the reason I keep having to import his script again. But why don't I get this dialog when I recreate the script???????? And why does it quit working once I get his imported and adjusted then close the program and open it again? Is it due to using only Filemaker 8.5, do I need Advanced or something? Another Question -- Is there another way that I can Isolate the records I want to use without using Find? The find is a bit clunky as sometimes I have to do pretty complicated find requests to get the products that I need. Thanks for any and all help you can provide. Link to comment Share on other sites More sharing options...
AHunter3 Posted March 13, 2008 Share Posted March 13, 2008 a) what value do you set the variable $ProductID to in your second step of your script? b) there is no such script step as Go to New Table. What is your fourth script step, really? Go to Next Record? Go to Layout named "New Table"? c) what is SkipNumber? I assume it is a calc field? Please provide the field def for SkipNumber. d) Examine this loop, from your script: LoopExit Loop if [Get (FoundCount) >= SkipNumber New Record/Request End Loop You're making a bunch of new records here. Why? They will be blank. Give or take auto-enter options, that is. Later you import records. I am going to guess that the import routine was SUPPOSED to import matching records in found set? But the blank records constituting the found set should not match anything, unless there's an auto-enter option that you did not explain. Link to comment Share on other sites More sharing options...
noellefoto Posted March 14, 2008 Author Share Posted March 14, 2008 aHunter3, thanks for replying. I actually just figured out my problem! Comment has another field called Products::CDataIDR which is Case ( Get ( CalculationRepetitionNumber ) ≤ Extend ( LabelsQty ) ; Extend ( DataID ) ) and this is a number field with 50 repetitions. This is the match field for the import as opposed to the ProductID field. So it goes Products::CDataIDR to Labels::ProductID, then the dialog box asking to split into separate records pops up. I must have changed that somehow when the script didn't work for another reason and messed myself up. But to furnish you with the information you asked for: a. $ProductID is set to Products::ProductID b. Go to layout "Product Labels" c./d. SkipNumber is a global number field. I want to create blank records in the labels layout so that the used labels on a label page will be skipped, and the first record will start on the first label after the SkipNumber (the first unused label), if that makes sense. It's all in Comment's script, although I think he calls it gSkipLabels. Then the script should Import the records for the labels for the designated number of times in a field called LabelsQty which is just a number field where I set the label quantity. So, there you are. I'm slowing starting to actually understand what is happening in Filemaker as opposed to when I started where I just copied demo files. I guess I knew it was in the relationship for the import, just not what was causing the problem. Thanks so much. Link to comment Share on other sites More sharing options...
Recommended Posts