Jump to content
Sign in to follow this  

Print By Barcode

Recommended Posts


Well, its not complete, its a concept script, i was working with the idea as follows:

students use a SubmitWork program (i have this, and its in use, i might post it later) to send a file to the "printer" folder, they then goto the central printer, scan the barcode on their library card.. and it reads a database (ini file, only a couple of hundred students, so its not like a data base would speed this up) list for their username, then scans for and finds the files which belong to them (based on the Owner attribute of the file, gained using the extprop functions, thanks Simucal for those), and then prints those files.

i never got around to adding in an option to decide which files actually print. and i never got around to adding the Print function:

_FilePrint ( $s_File [, $i_Show] )

But it should be pretty straight forward really, if anyone wants to take it further, please do, i would love to see a program like this in 100% working order (as this one stands, its almost complete)

Current output

requires extprop.au3 for some functions:, you can get it here:


other notes:

There are a LOT of message boxes that popup when you run it, as i said, was concept testing, so i was giving myself prompts all the way through.

Does not work for all file types (for instance, would not print a .au3 file)

_FilePrint function uses default printer, so i set mine to the Microsoft Office Document image writer for testing

Ask for anything you want to know, i might still have some other info on it all.

#cs ----------------------------------------------------------------------------

 AutoIt Version:
 Author:         tAKTelapis

 Script Function:
    Scans a Barcode, and prints files belonging to the user of that Barcode.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <extprop.au3>
#include <guiconstants.au3>
#include <file.au3>
#include <array.au3>

Dim $PrintFiles[1]

$iniFile = "c:\Barcodes.ini"
$barcode = InputBox("Print by Barcode", "Please scan your barcode")
$domain = IniRead($iniFile, "NetworkSettings", "Domain", "")
$username = $domain&"\"&(IniRead($iniFile, "Barcodes", $barcode, "User Does not exist" ))

MsgBox(0, "username", "username is "&$username)

If (Not IsArray($FileList)) and (@Error=1) Then
    MsgBox (0,"","No Files\Folders Found.")

For $i = 1 to $FileList[0] Step 1
$pfile = 'C:\print\'&$FileList[$i]
$owner = _GetExtProperty($pfile, 8)
    if $owner = $username Then
        _ArrayAdd($PrintFiles, $FileList[$i])

For $i = 1 to UBound($PrintFiles) -1
    MsgBox(0, "Now Printing", $PrintFiles[$i])
Edited by tAKTelapis

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this