As a necessity of my job, we need to be able to dump files tp a directory. This directory needs to be “watched” and should print any new files added to the directory. I have created a script (1st one!) that will do this - however, I need to refine it. Maybe some of you more experienced guys could help out? Here is my script as is is so far:
on adding folder items to this_folder after receiving these_items
tell application “GraphicConverter”
printfolder this_folder without dialog
end tell
tell application “Finder”
delete these_items
end tell
end adding folder items to
I attach this script as a folder action to a folder on one of our servers. I want to refine it a bit though…
I want to be able to script which printer will be printing the files. Right now, the above script prints to the default printer. I have 2 other printers to incorporate. I am figuring I will need 3 seperate scripts, running on 3 different folders - I just need the syntax to input into each script to assign each to a specific printer.
p.s. If anyone wonders why I am employing GraphicConverter, as oppsosed to Finder printing - I ran into issues utilizing finder printing for .ps/.eps files
I have modified to script a bit…I added a portion that changes the default printer.
Is there a better way to do this though? Can I just send one of my files to the printer directly, without having to change the default printer in print center?
Here is the updated script:
on adding folder items to this_folder after receiving these_items
tell application “Printer Setup Utility”
activate
set current printer to printer (“Accel-a-writer 4g” as string)
quit
end tell
tell application “GraphicConverter”
printfolder this_folder without dialog
end tell
tell application “Finder”
move these_items to “vol1:proofers:printed:”
end tell
end adding folder items to
That was helpful. I have another question/scenario to ask about…
My script moves the files to a folder after it has been printed. I noticed that if a file exists in the “printed” folder already that is named identically to the file currently being printed - the ‘new’ file won’t move over.
I am curious, can I script the finder to append the name of the file it is attempting to move, if it finds an identically named one in the destination? Like if you download, for example, the same file twice - you will have two files, one appended in a way to differ from the first.
your latest posting - this script will display a prompt to the user to select which printer?
That is a convenient feature, but my needs dictate this function should be entirely automated. So, for this purpose, asking the user to select the printer may not be efficient. Thanks for all your help though