How turn a folder into a print queue?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












4















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.










share|improve this question


























    4















    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.










    share|improve this question
























      4












      4








      4


      1






      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.










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 26 at 9:37









      benwiggybenwiggy

      1,01029




      1,01029




















          1 Answer
          1






          active

          oldest

          votes


















          8














          There is a simpler solution in 4 steps and a small shell script:




          1. make your own spool directory:



            /usr/bin/sudo mkdir /var/spool/my_printer



          2. 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
            done



          3. make your my_spooler executable:



            chmod u+x my_spooler



          4. start it:



            my_spooler &


            it should start without a full path if /local/bin is within your PATH
            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





          share|improve this answer























          • 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










          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
          );



          );













          draft saved

          draft discarded


















          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









          8














          There is a simpler solution in 4 steps and a small shell script:




          1. make your own spool directory:



            /usr/bin/sudo mkdir /var/spool/my_printer



          2. 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
            done



          3. make your my_spooler executable:



            chmod u+x my_spooler



          4. start it:



            my_spooler &


            it should start without a full path if /local/bin is within your PATH
            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





          share|improve this answer























          • 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















          8














          There is a simpler solution in 4 steps and a small shell script:




          1. make your own spool directory:



            /usr/bin/sudo mkdir /var/spool/my_printer



          2. 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
            done



          3. make your my_spooler executable:



            chmod u+x my_spooler



          4. start it:



            my_spooler &


            it should start without a full path if /local/bin is within your PATH
            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





          share|improve this answer























          • 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













          8












          8








          8







          There is a simpler solution in 4 steps and a small shell script:




          1. make your own spool directory:



            /usr/bin/sudo mkdir /var/spool/my_printer



          2. 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
            done



          3. make your my_spooler executable:



            chmod u+x my_spooler



          4. start it:



            my_spooler &


            it should start without a full path if /local/bin is within your PATH
            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





          share|improve this answer













          There is a simpler solution in 4 steps and a small shell script:




          1. make your own spool directory:



            /usr/bin/sudo mkdir /var/spool/my_printer



          2. 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
            done



          3. make your my_spooler executable:



            chmod u+x my_spooler



          4. start it:



            my_spooler &


            it should start without a full path if /local/bin is within your PATH
            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






          share|improve this answer












          share|improve this answer



          share|improve this answer










          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

















          • 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

















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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






          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?