How turn a folder into a print queue?
Clash Royale CLAN TAG#URR8PPP
On MacOS, you can drop a PDF directly onto the window of a Printer's print queue, and it will be sent to print immediately (with the printer's default settings).
I'm looking for a way to do a similar thing with a specified folder. E.g. Any PDF or PostScript file dropped onto that folder (or saved there through any other method) will be sent straight to the printer.
The obvious thing is to use Folder Actions and an AppleScript, but I'm wondering if there's a neater solution that I've overlooked? Essentially, I'm looking for a filepath that works as a print queue.
printing cups
add a comment |
On MacOS, you can drop a PDF directly onto the window of a Printer's print queue, and it will be sent to print immediately (with the printer's default settings).
I'm looking for a way to do a similar thing with a specified folder. E.g. Any PDF or PostScript file dropped onto that folder (or saved there through any other method) will be sent straight to the printer.
The obvious thing is to use Folder Actions and an AppleScript, but I'm wondering if there's a neater solution that I've overlooked? Essentially, I'm looking for a filepath that works as a print queue.
printing cups
add a comment |
On MacOS, you can drop a PDF directly onto the window of a Printer's print queue, and it will be sent to print immediately (with the printer's default settings).
I'm looking for a way to do a similar thing with a specified folder. E.g. Any PDF or PostScript file dropped onto that folder (or saved there through any other method) will be sent straight to the printer.
The obvious thing is to use Folder Actions and an AppleScript, but I'm wondering if there's a neater solution that I've overlooked? Essentially, I'm looking for a filepath that works as a print queue.
printing cups
On MacOS, you can drop a PDF directly onto the window of a Printer's print queue, and it will be sent to print immediately (with the printer's default settings).
I'm looking for a way to do a similar thing with a specified folder. E.g. Any PDF or PostScript file dropped onto that folder (or saved there through any other method) will be sent straight to the printer.
The obvious thing is to use Folder Actions and an AppleScript, but I'm wondering if there's a neater solution that I've overlooked? Essentially, I'm looking for a filepath that works as a print queue.
printing cups
printing cups
asked Jan 26 at 9:37
benwiggybenwiggy
1,01029
1,01029
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
There is a simpler solution in 4 steps and a small shell script:
make your own spool directory:
/usr/bin/sudo mkdir /var/spool/my_printer
write the following shell script within your usual local bin directory
let's say/local/bin
cd /local/bin
copy the following inside
my_spooler
:#!/bin/sh
# go into the spool directory
cd /var/spool/my_printer
# main loop: loop till end of time
while : ; do
# check for any newly arrived text file
for _file in * ; do
# if _file is a normal file, print and remove it (-r option to lpr)
[ -f "$_file" ] && lpr -r "$_file"
done
# don't loop like a fool
sleep 300
donemake your
my_spooler
executable:chmod u+x my_spooler
start it:
my_spooler &
it should start without a full path if
/local/bin
is within yourPATH
if it isn't, then start it this way:/local/bin/my_spooler &
The ending
&
means start it in background so as not to block your session waiting until the end of time.
How to use it
To use it you simply have to move any text or PS or PDF file within your own defined spool directory how you prefer. Either with the Finder
or with basic command line:
cp my_file.pdf /var/spool/my_printer
Shell script not yet checked. If it's working just send me a 😀.
– daniel Azuelos
Jan 26 at 12:33
Thanks. This is part of a larger project, so I'll let you know when it bears fruit, but it looks good.
– benwiggy
Jan 26 at 18:53
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "118"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fapple.stackexchange.com%2fquestions%2f349726%2fhow-turn-a-folder-into-a-print-queue%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
There is a simpler solution in 4 steps and a small shell script:
make your own spool directory:
/usr/bin/sudo mkdir /var/spool/my_printer
write the following shell script within your usual local bin directory
let's say/local/bin
cd /local/bin
copy the following inside
my_spooler
:#!/bin/sh
# go into the spool directory
cd /var/spool/my_printer
# main loop: loop till end of time
while : ; do
# check for any newly arrived text file
for _file in * ; do
# if _file is a normal file, print and remove it (-r option to lpr)
[ -f "$_file" ] && lpr -r "$_file"
done
# don't loop like a fool
sleep 300
donemake your
my_spooler
executable:chmod u+x my_spooler
start it:
my_spooler &
it should start without a full path if
/local/bin
is within yourPATH
if it isn't, then start it this way:/local/bin/my_spooler &
The ending
&
means start it in background so as not to block your session waiting until the end of time.
How to use it
To use it you simply have to move any text or PS or PDF file within your own defined spool directory how you prefer. Either with the Finder
or with basic command line:
cp my_file.pdf /var/spool/my_printer
Shell script not yet checked. If it's working just send me a 😀.
– daniel Azuelos
Jan 26 at 12:33
Thanks. This is part of a larger project, so I'll let you know when it bears fruit, but it looks good.
– benwiggy
Jan 26 at 18:53
add a comment |
There is a simpler solution in 4 steps and a small shell script:
make your own spool directory:
/usr/bin/sudo mkdir /var/spool/my_printer
write the following shell script within your usual local bin directory
let's say/local/bin
cd /local/bin
copy the following inside
my_spooler
:#!/bin/sh
# go into the spool directory
cd /var/spool/my_printer
# main loop: loop till end of time
while : ; do
# check for any newly arrived text file
for _file in * ; do
# if _file is a normal file, print and remove it (-r option to lpr)
[ -f "$_file" ] && lpr -r "$_file"
done
# don't loop like a fool
sleep 300
donemake your
my_spooler
executable:chmod u+x my_spooler
start it:
my_spooler &
it should start without a full path if
/local/bin
is within yourPATH
if it isn't, then start it this way:/local/bin/my_spooler &
The ending
&
means start it in background so as not to block your session waiting until the end of time.
How to use it
To use it you simply have to move any text or PS or PDF file within your own defined spool directory how you prefer. Either with the Finder
or with basic command line:
cp my_file.pdf /var/spool/my_printer
Shell script not yet checked. If it's working just send me a 😀.
– daniel Azuelos
Jan 26 at 12:33
Thanks. This is part of a larger project, so I'll let you know when it bears fruit, but it looks good.
– benwiggy
Jan 26 at 18:53
add a comment |
There is a simpler solution in 4 steps and a small shell script:
make your own spool directory:
/usr/bin/sudo mkdir /var/spool/my_printer
write the following shell script within your usual local bin directory
let's say/local/bin
cd /local/bin
copy the following inside
my_spooler
:#!/bin/sh
# go into the spool directory
cd /var/spool/my_printer
# main loop: loop till end of time
while : ; do
# check for any newly arrived text file
for _file in * ; do
# if _file is a normal file, print and remove it (-r option to lpr)
[ -f "$_file" ] && lpr -r "$_file"
done
# don't loop like a fool
sleep 300
donemake your
my_spooler
executable:chmod u+x my_spooler
start it:
my_spooler &
it should start without a full path if
/local/bin
is within yourPATH
if it isn't, then start it this way:/local/bin/my_spooler &
The ending
&
means start it in background so as not to block your session waiting until the end of time.
How to use it
To use it you simply have to move any text or PS or PDF file within your own defined spool directory how you prefer. Either with the Finder
or with basic command line:
cp my_file.pdf /var/spool/my_printer
There is a simpler solution in 4 steps and a small shell script:
make your own spool directory:
/usr/bin/sudo mkdir /var/spool/my_printer
write the following shell script within your usual local bin directory
let's say/local/bin
cd /local/bin
copy the following inside
my_spooler
:#!/bin/sh
# go into the spool directory
cd /var/spool/my_printer
# main loop: loop till end of time
while : ; do
# check for any newly arrived text file
for _file in * ; do
# if _file is a normal file, print and remove it (-r option to lpr)
[ -f "$_file" ] && lpr -r "$_file"
done
# don't loop like a fool
sleep 300
donemake your
my_spooler
executable:chmod u+x my_spooler
start it:
my_spooler &
it should start without a full path if
/local/bin
is within yourPATH
if it isn't, then start it this way:/local/bin/my_spooler &
The ending
&
means start it in background so as not to block your session waiting until the end of time.
How to use it
To use it you simply have to move any text or PS or PDF file within your own defined spool directory how you prefer. Either with the Finder
or with basic command line:
cp my_file.pdf /var/spool/my_printer
answered Jan 26 at 12:27
daniel Azuelosdaniel Azuelos
8,03523394
8,03523394
Shell script not yet checked. If it's working just send me a 😀.
– daniel Azuelos
Jan 26 at 12:33
Thanks. This is part of a larger project, so I'll let you know when it bears fruit, but it looks good.
– benwiggy
Jan 26 at 18:53
add a comment |
Shell script not yet checked. If it's working just send me a 😀.
– daniel Azuelos
Jan 26 at 12:33
Thanks. This is part of a larger project, so I'll let you know when it bears fruit, but it looks good.
– benwiggy
Jan 26 at 18:53
Shell script not yet checked. If it's working just send me a 😀.
– daniel Azuelos
Jan 26 at 12:33
Shell script not yet checked. If it's working just send me a 😀.
– daniel Azuelos
Jan 26 at 12:33
Thanks. This is part of a larger project, so I'll let you know when it bears fruit, but it looks good.
– benwiggy
Jan 26 at 18:53
Thanks. This is part of a larger project, so I'll let you know when it bears fruit, but it looks good.
– benwiggy
Jan 26 at 18:53
add a comment |
Thanks for contributing an answer to Ask Different!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fapple.stackexchange.com%2fquestions%2f349726%2fhow-turn-a-folder-into-a-print-queue%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown