Prompt User For Source File S’abonner

0
Avatar
Legacy Poster

Is it possible to prompt the user for a source file?

 

I am building a data file to make sheets of labels all at once (rather than printing them by hand, we're printing them on a printing press. What once took us twelve hours to print (50,000 labels) now takes us an hour total) I am basically implementing a cut-stack imposition (where, when the sheets are all stacked, a given column of the cut labels will go 1,2,3,4 which means my sheet must go 1,501,1001...) 

 

I have a program written that takes care of all of that and splits it out into manageable quantities for the cutter, BUT now I am running into the problem of I need to print off of each of these files (sometimes as many as 9 or 10 parts in a customer print job) and I'm trying to determine if there is a way to adjust my one btw file to look at a different file as it's datasource without manually changing my datasource?

 

I am looking into it myself, but I was wondering if anyone out there just knew of a way. 

6 commentaires

0
Avatar
Shotaro Ito
Modérateur
Actions pour les commentaires Permalien

For Automation edition or above, when you use text database (csv, tab separated etc) you can switch database by /D="<database file path>" command line option.

...bartend.exe /AF="c:\btw\myformat.btw" /P /D="c:\data\mydata.csv"

Where /AF opens document, /P prints document, /D specifies which text database to use and /X closes bartender. 

for detail, see Command line parameter reference in BarTender help > Automating BarTender.

 

Commander middleware coming with BarTender will automatically do that - once you drop a trigger (text file) to specified scan folder,

Commander renames the trigger file and print. for procedure, see Commander white paper's example #2.

http://www.seagullscientific.com/label-software/whitepapers/overview-of-commander-new-201406.pdf

 

you can create a simple application to allow users to select a text file then drop the file to the scan folder.

 

For OLEDB/ODBC like Excel / Access / SQL database there's no such option. usually you need to export text file from the database.

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

This solution is  very nice. I'll probably build the print line code into my existing program! It can split them up and offer the print imposition files to PDF if bartend.exe is found!

 

Now the only fun part is moving the exe I'm compiling to the machine that has bartender over and over :S 

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

SO, I'm working on building the command now - it's a beastie alright - shown below, where 999999_Part-A_500.txt is the part that I need to change per opening. I have all that working, but I'm just trying to confirm the setup in the label format. So, when I specify /D it will replace the first text database, basically it's the same as setting up the text file database (correct delimiters, header line, et cetera) and then just going to the "Database Connection Setup" window, selecting the first text file database, and selecting a different file,  is that right? 

"C:\Program Files (x86)\Seagull\BarTender Suite\bartend.exe" "/AF=H:\Main Storage\Labels\Label Formats\02142014.btw /P /D=C:\DataDump\Imposifier\999999_Part-A_500 /X"

 

 


 

/D="<path to data file>"


Sets or changes the text file database to be used. If no connection to a text file database has been added to the label format, the /D parameter adds it. (BarTender will assume that the first line of the file is a header that contains the field names and that the data fields are delimited with the mixed-quote-and-comma method.) If connections to one or more text file databases have already been added, the file specified with the /D parameter replaces the first text database. (BarTender will assume that the new file uses the same delimitation method as the original file, and it will assume that the first line is a header of field names if and only if the original file had such a header.) The /D parameter applies to all open label formats unless the /AF= parameter has been used. A full path to the database may need to be specified. See How BarTender Processes Path and File Names for more information.

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

I tried "C:\Program Files (x86)\Seagull\BarTender Suite\bartend.exe" "/AF=H:\templabeling_Samples.btw /p /D=C:\DataDump\Imposifier\999999_Part-C_57.txt /X"  with /P /PD /p /pD /pd /Pd and it's not working

 

I am on an edition that supports this right?

 

Edit: HMMM, playing with individual pieces, I can: 

 

Load the format:          ".../bartend" "/AF=H:\templabeling_Samples.btw"

Adjust Datasource:      ".../bartend" "/D=C:\DataDump\Imposifier\999999_Part-C_57.txt"

Print (w or w/o Dialog:  ".../bartend" /P

 

(repeat adjusting datasource for other files. One /D and then /PD command for each)

 

close bartender:           ".../bartend" /X

 

So, it's doable, just as far as I can tell, not in a single command. Maybe a single line like the form 

".../bartend" "/AF=..." &&  ".../bartend" "/D=..." && ".../bartend" /P && .... && ".../bartend" /X 

but I cant get /P and any of them to combine, or /X and any of them (at least not right. It opens the program, closes the label and leaves the program itself still open. /X again by itself closes the program too)

 

Edit again: /AF and /D are working together. making the command chains/bat file possibilities less cumbersome. This only works is the label is already open though. That means if your old source file is gone, you get an error on opening with /AF you could avoid this by using a dummy file as soruce right before close. Something like: 

/AF to open format

/AF /D to ensure proper label selected and datasource of file 1

/P print 

/AF /D to ensure proper label selected and datasource of file 2

/P print 

 

(repeat /AF /D and then /P until done)

 

/D to dummy data file

/X to close program

 
0
Avatar
Shotaro Ito
Modérateur
Actions pour les commentaires Permalien

Umm.. trust me, Try Commander and your life will even be easier.

It does what you do (keep open a document and print while switching data file), by just drop csv file to a folder.

It helps you to create command line options with GUI assist too.

 

Note that in default, Commander runs Service mode, so if you want to access mapped drive (H:) and show print dialog,

you need to run Commander in application mode in Administer > Service setup,

then make BarTender UI  / interactive dialog visible from Detection > Command handler setup.

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

Yeah, I'm thinking that commander would be the way to go. Trying to make a program to manipulate it through command line is not workign well for me. 

Vous devez vous connecter pour laisser un commentaire.