tAKTelapis Posted May 21, 2007 Share Posted May 21, 2007 (edited) 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 outputrequires extprop.au3 for some functions:, you can get it here:http://www.autoitscript.com/forum/index.ph...t=0&start=0other 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 testingAsk for anything you want to know, i might still have some other info on it all.expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.1.1.0 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) $FileList=_FileListToArray('c:\print') If (Not IsArray($FileList)) and (@Error=1) Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf _ArrayDisplay($FileList,"$FileList") 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]) EndIf Next For $i = 1 to UBound($PrintFiles) -1 MsgBox(0, "Now Printing", $PrintFiles[$i]) _FilePrint("C:\print\"&$PrintFiles[$i]) Next Edited May 21, 2007 by tAKTelapis Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now