Print file without opening
I am trying to print a file through apple script, in the end i want this file to be run when a rule in mail is triggered however at the moment I am just testing sections.
I was trying to emulate dragging and dropping the file to the printer.
When I run this script I get the error "Finder got an error: Handler can’t handle objects of this class." where am I going wrong, I am pretty new to apple script.
set theFile to "/Users/user/Desktop/print test.pdf"
tell application "Finder"
set sel to the theFile
open sel using POSIX file "/Users/user/Library/Printers/HP LaserJet 4000 Series (0001E66E3E6D).app"
end tell
MacBook Pro (13-inch Mid 2012), OS X Mavericks (10.9.4)