Batch printing using Applescript - no longer works

For several years I have been using a simple Applescript to monitor the contents of a folder, print new files then delete these files:
on adding folder items to this_folder after receiving added_items
repeat with each_item in added_items
tell application "AddPrinter" to open each_item
delay 30
tell application "Finder" to delete each_item
tell application "AddPrinter"
quit
end tell
end repeat
end adding folder items to
After the last Mavericks update it has stopped working and gives the error message "the document m3.txt could not be opened. AddPrinter cannot open files in the text format"
The same happens for PDF files - it seems that AddPrinter app has been changed and this functionality no longer works.
Is there some way to restore the previous AddPrinter functionality (I tried copying and using an old verison of the app, without success)?
Or is there another app that will work as intended?

I have found an alternative to the AddPrinter.app that sort of works in this Macscripter tip from 2004:
http://macscripter.net/viewtopic.php?id=9835
do shell script "/usr/bin/lp '"
calls up the Unix print command (LP = line printer!)
This enables me to print .txt, rtf, pdf and jpg files
Here is the new script:
on adding folder items to this_folder after receiving these_items
    try
        tell application "Finder"
            repeat with i from 1 to number of items in these_items
                try
                    set this_item to item i of these_items
                    set the path_string to this_item as string
                    set the final_path to POSIX path of the path_string
                    do shell script "/usr/bin/lp '" & final_path & "'"
                on error error_message
                end try
                delay 30
                tell application "Finder" to delete this_item
            end repeat
        end tell
    on error error_message
    end try
end adding folder items to
Now I just need to find out how to do some minor formatting such as font size and margins...
Now digging into the CUPS manual:
http://www.cups.org/doc-1.1/sum.html

Similar Messages

  • Print Preview is no longer working. Windows pops and then closes.

    The Print Preview function no longer works. Clicking Print Preview results in
    (1) a small window pops open in the middle of the screen then disappears
    (2) then a large window opens (to preview the content as it once did)
    (3) then the new windows disappears (shrinks out of sight) and apparently dies
    (4) "Print previewing message..." appears in the status bar until the cursor is moved off the page.
    In case it also isn't working, the system information includes:
    Windows 7 64-bit SP1
    The Troubleshooting Information is:
    Name: Thunderbird
    Version: 31.3.0
    User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0
    Profile Folder: Show Folder
    (Local drive)
    Application Build ID: 20141127140543
    Enabled Plugins: about:plugins
    Build Configuration: about:buildconfig
    Memory Use: about:memory
    ... well, the rest wouldn't fit (something about a character limit) and the attachment part only works with images!

    Does it still fail to work if you restart thunderbird in Safe Mode?
    In Thunderbird
    Help > Restart with addons disabled

  • After upgrading the new operating system, it seems some useful features no longer work such as when typing a message the text anticipates the next word and when trying to delete individual messages from a contact, you can no longer tap and hold to select

    After upgrading the new operating system on my Droid Razr M it seems some useful features no longer work such as when typing a message the text anticipates the next word and when trying to delete individual messages from a contact, you can no longer tap and hold to select multiple message you have to delete them individually or the entire thread. Is there a way to get these back?

    Well, that's kind of embarrassing. And I honestly thought I paid attention to that... It works perfectly now, thank you so much!
    As expected, cdm-git also works fine since DMs only work in the root mode as of now.
    Just for the record, both type commands output "/usr/bin/startx" and pacman -Q gives "systemd 215-4".
    Last edited by looki (2014-08-23 13:04:49)

  • Windows Server 2012 - Printing using UNC path not working

    Hi,
    I have a problem printing using the printer's UNC path ("\\Server_Name\Printer_Hostname") to work with a web
    app hosted on IIS 8. With a windows forms application the UNC path is working fine and the app prints.
    With
    the web app I receive an error "The data area passed to a system call is tool small". 
    Also,
    in the event viewer under Applications and Services Logs -> Microsoft -> PrintService -> Operational, I receive the error "The print spooler failed to reopen an existing printer connection because it could not read the configuration information
    from the registry key S-1-5-82-1980832875-2702362896-1795126167-3622310632-1152289074\Printers\Connections. The print spooler could not open the registry key. This can occur if the registry key is corrupt or missing, or if the registry recently became unavailable."

    I have contacted IIS forum support.
    Please review the link: http://forums.iis.net/p/1213109/2079229.aspx?Re+Windows+Server+2012+Printing+using+UNC+path+not+working
    Their final response:
    Printing from ASP.NET using System.Drawing.Printing itself is a horrible approach, as this namespace was designed for Windows Forms only. The designers did not take everything about ASP.NET in mind, so any issue can happen. That can answer why the HP model
    works while the Samsung fails, as the HP one just "happens
    to work",
    http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.aspx
    Similarly, System.Printing was designed just for WPF.
    About which printing API to use in ASP.NET/IIS, there is no clear answer so far. Thus, your only resource is Microsoft support, who can perform further analysis (with their dedicate utilities and of course Windows source code) and might come across a solution
    to help you out. This is not a trivial scenario.

  • HT5624 Hi, I have an iPad with a different iCloud username and password then my Apple ID. I forgot my iCloud password and the email I used is no longer working. How do I change my iCloud I'd and password to match my Apple ID one? Thanks in advance

    Hi, I have an iCloud account with a different iCloud username and password then my Apple ID. I forgot my iCloud password and the email I used is no longer in use. How do I change my iCloud Username and password to match my Apple ID one? Thanks in advance

    Hi Cplantin!
    Here is an article for you that will help you with this question:
    iOS 7: If you're asked for the password to your previous Apple ID when signing out of iCloud
    http://support.apple.com/kb/TS5223
    Take care, and thanks for visiting the Apple Support Communities.
    -Braden

  • Auto printing using Applescript

    Hi,
    I am trying to get Applescript to automatically print a document from an application (Intaglio) using the standard Apple print dialog sheet. I have gotten this much of the script working:
    tell application "Intaglio"
    activate
    tell application "System Events"
    keystroke "p" using command down
    delay 2 -- (seconds)
    -- Some how select printer "Foo"
    -- Some how click checkbox "Two-Sided"
    --click checkbox "Two-Sided" of sheet 1 of window "Test.intaglio"
    keystroke return
    end tell
    quit
    end tell
    However, I cannot figure out how to select a printer from the "Printer:" pop up menu. Nor can I figure out how to "click" a checkbox. I would be very grateful if anyone could offer any suggestions on accomplishing these two tasks. Thanks
    -p

    edit: make sure you have 'enable access for assisted devices' selected in 'system preferences-universal access-seeing'
    On your computer you have an application called Accessibility Inspector. This will help give you the correct names for addressing all the elements of the window.
    Below is just an example of what the syntax might be.
    tell application "Intaglio" to activate
    tell application "System Events"
    tell process "Intaglio"
    select item 2 of menu 1 of tab 1 of window "Print"
    delay 1
    click button 3 of tab 1 of window "Print"
    end tell
    end tell
    Message was edited by: taylor.henderson

  • Printing to pdf no longer works

    A recent "upgrade" of both operating system and Acrobat software now means that trying to do something like print a web page to a pdf document does not work - crashing the primary application {Safari}.  This means that there are at least three places where the errors are occurring - the OS, Safair or pdf writing tool.  Any clues?
    Also, one tempting alternative is the Adobe PDF 7.0 driver that comes as a printer driver.  Documents get spooled to an application that opens a nicely formed pdf document but errors in the log occur "on hold, authentication required" which doesn't have an associated dialogue box or anywhere to go.  I can't then get the document to actually print and use.  Temptingly so close but yet so far.
    Environment:  OS 10.7.4 with all updates applied {as at 09/2012)
    Safari: Version 6.0 (7536.25)
    Adobe:  Acrobat Pro v10.1.4
    Thanks.

    You never know, someone might remember. What happens in detail when you try to use it, and HOW are you trying to use it?

  • Moved Acrobat from C drive to D drive, print to PDF no longer works.  How can I fix this?

    I recently moved a few programs from my C drive to the D drive to free up space.  Now, choosing "Adobe PDF" as the printer no longer seems to work.  The save screen appears, but no PDF is created.  Do I need to reconfigure the Adobe "printer" or similar?  Thanks.

    Hey parlorsoldier,
    Could you please elaborate the same on how have you moved Acrobat from C to D drive.
    Did you completely uninstalled the software and then performed custom installation for the C drive location.
    Let me know your workflow, please.
    Regards,
    Anubha

  • Applescripts no longer work

    Hi all,
    I had to update some old applescripts, but apparantly none of them work anymore on my machine (OSX Mavericks).
    It seems to be related with calling InDesign (tried with CS5, 55 and 6), but I'm not sure.
    Sample:
    set myJavaScript to "alert (\"lalala\");"
    tell application "Adobe InDesign CS6"
              do script myJavaScript language javascript
    end tell
    Result:
    Sytax error:
    Expected end of line but found “script”.
    This used to work fine and actually still works on other machines (also OSX Mavericks)
    Hoping anyone has experienced something like this and knows a solution...
    Thanks!

    Apparently the AppleEvent subsystem can not even resolve the application by name.
    The reported error could just be an applescript way to indicate a syntax error, e.g. the terminology data is not available - the equivalent to ExtendScript's OMV data needed to compile the script.
    What happens if you execute the following script:
    get path to application "Adobe InDesign CS6"
    The event log should yield a meaningful path to the InDesign app...
    You could also try to compile the script as script-application on a different machine and transfer the complete applet. If you run it you may find out which program is pretending to be InDesign.
    Dirk

  • Batch Rename Keyboard Shutcut no longer works

    I posted about this before and tried deleting the associated plist files as suggested by Old Toady.
    It didn't work so I waited until a new install of iphoto and it's back again after fresh install.
    I've tried making a custom shortcut in system prefs| keyboard using different and the same cmd+shift+B but that doesn't work either.
    Other keyboard short cuts work but the one I use most ( for batch rename ) is not.
    The mouse click does however.
    Can anyone suggest anything ?

    I'm back with this old problem
    Over the weekend , I upgraded to Mountain Lion and also the latest ver of Iphoto required to work correctly with ML.
    Same problem the keyboard shortcut for Batch Edit ( CMD+Shift+B ) doesn't work.
    Can anyone suggest a way to make a *different* shortcut for this function if the normal one doesn't work?
    It's probably the shortcut I use most .

  • Print to pdf no longer works. Ver8, vista

    been running ver8 on laptop vista for 3 years w/o any issues, printing to pdf from web, from word, from everything.
    suddenly lost that capability. file/print/pdf - then nothing.... no dialogue box - just goes back to where I was.
    'repaired' Acrobat from hard drive. then repaired from CD.  then deleted 2nd acrobat copy in printer list - could not delete first acrobat copy on printer list.
    then did windows uninstall acrobat. reinstalled 5.0, then upgraded to 8.0 (necessary sequence).
    new adobe printer appears on list
    (recalling, though, never saw the question "do you want to install acrobat as a printer" - but it did.   is that recalling from a really older version install?  yet it did install one)
    open word, try to print to new adobe printer - immediate "bang" sound and a small square box with a red X and no message
    went back to word, choose original (unremoveable) acrobat on printer list - get driver issue box.
    checked services - print spooler is on
    three hours into this - ready to chuck this whole thing
    (a PC user since first Intel 8086 with 128K memory - just bought first mac (a laptop) and LOVING it - maybe vista is just throwing a jealous hissy fit)
    appreciate any help!!!

    If you are coming in by e-mail, you might have to login on the web to include the attachment. Apparently attachments do not work from the e-mail connection.
    In the meantime, try to print to the Adobe PDF printer with the print-to-file selected. If you get a file, then open the file in Distiller to complete the process. If these two steps work, then it is likely an issue with AcroTray.exe. The AcroTray program is typically located in the Distiller folder.
    Bill

  • HT204053 Hello, i wanted to ask if i can put in a diffrent email for my iCloud so that the verifying email could be sent to, beacause the first mail i was using is no longer working and that way i can't backup my stuff into iCloud..please help.

    It's not actually my account but it was already in the iPad when i first bought and i've been using this ID for more than three years now, but all the email and verifying email from iTunes get send there instead of my own email, and even that i tried to log in the person's mail it was deleted and no more excisted so i can't verify to iCloud , what can i do? Can i replace the email of the ID with my own?
    Please help.

    All downloads from iTunes are tied to the account that downloaded it, you can't re-download content via a different account. You checked the spam folder on yourr old account as well as the Inbox, and depending upon how long ago you did it, have you retried getting it reset : http://appleid.apple.com, then 'reset your password' ?

  • Printing using Adobe Reader not working

    I am using .NET to open .pdf file with "Print" option. This should print that .pdf file on default printer of the system. But in reality, when I run my program, it opens blank Adobe Reader window and just hangs there, no page gets printed. My C# code looks like following:
    Process process1 = new Process();
    process1.StartInfo.UseShellExecute = true;
    process1.StartInfo.Verb = "Print";
    process1.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
    process1.StartInfo.FileName = completeFileName;
    process1.Start();
    Above code could also be written in vbScript.
    Can anyone let me know why Acrobat Reader does not print any page?
    Thank you in advance.

    The paper trays are both 8" x 11". The top tray has checks, the bottom tray has plain paper. When I go to print, the print dialog defaults to the last saved setting which is supposed to use the lower tray, however when checking the setting it says upper tray. I have to switch to either another setting or to the Standard setting, then back to my saved setting in order for the paper tray to be set correctly on the lower tray. I would expect that whatever setting the saved setting has, it would change to the necessary settings and use it instead of using a default settings. I don't know if this is a bug in the OS X or the HP driver.
    For example. I go to print in Safari, the printer says OfficeJet 7140xi, the Preset setting says OfficeJet (Lower Tray). When I check Paper Type/Quality, the paper tray is set to Upper Tray. I switch the Preset to Standard and back to OfficeJet (Lower Tray) and check the Paper Type/Quality and now the paper tray is set to Lower Tray. So, initially, when the print dialog comes up, it ignores the Preset settings and defaults to some other settings and manually you have to switch the Preset to another setting and back again in order to get the correct settings.

  • Scheduled commands using at no longer work

    at worked fine up until a few days ago - it did work with 10.5.2, but some update after that broke it.
    You can schedule a command, but then, a random date is set, and the job has always the same id.
    Eg:
    $ at 0130 tomorrow
    echo "bubu"
    job 3 at Sun Mar 2 01:30:00 2008
    $ atq
    688128 Sun Sep 29 18:11:44 1929
    I've tried this on three different machines, all with 10.5.2 and the latest updates installed.
    Anyone has and idee???

    Interesting about the 'a' queue being hosed. I successfully submitted a job to the 'c' queue:
    % at -q c midnight
    echo "hello world!"
    job 5 at Sun Mar 23 00:00:00 2008
    % atq
    5 Sun Mar 23 00:00:00 2008
    Then I submitted the same job to the 'a' queue:
    % at midnight
    echo "hello world!"
    job 6 at Sun Mar 23 00:00:00 2008
    % atq
    688128 Tue Jun 10 02:58:44 2025
    5 Sun Mar 23 00:00:00 2008
    Looking in /var/at/jobs, I saw:
    % ls -l
    total 12
    -rwx------ 1 skip staff 2187 Mar 22 09:22 %A8000060132c3cc
    -rw-rw-r-- 1 root wheel 6 Mar 22 09:22 .SEQ
    -rw------- 1 root wheel 0 Mar 21 22:24 .lockfile
    -rwx------ 1 skip staff 2235 Mar 22 09:20 c000050132c3cc
    By renaming the first file there I was able to fix things:
    % mv %A8000060132c3cc a000060132c3cc
    % atq
    6 Sun Mar 23 00:00:00 2008
    5 Sun Mar 23 00:00:00 2008
    So, is Apple reading this forum or is there some "official" place to
    submit a bug report?
    Skip Montanaro

  • My XP printer no longer works with snow leopard over the network

    My XP networked printer (Samsung 4200) no longer works with snow leopard after Mac update.  Printer hooked up to XP and can access it through network.
    When I print it requests that I to authenticate the printer with a user name and password but it's not password protected. I don't have a password, but I tried all the usuals anyways. 
    It worked fine a couple days ago, and I've tried everything since.  I've reset my printers, turned off both computers.  Plugged the printer directly into the Mac - didn't work at first but downloaded a new driver Splix - 2 (Samsung doesn't make an OS X driver for this printer) and got it working.  Reinstalled Bonjour on the PC, which can't even see a printer now.  Any help would be hugely appreciated.
    THanks in advance.

    helpthismacuser wrote:
    When I print it requests that I to authenticate the printer with a user name and password but it's not password protected. I don't have a password, but I tried all the usuals anyways. 
    Connecting from a Mac to Windows is password protected. If you tried to connect to a shared folder on Windows you would also be prompted to enter your Windows credentials. So when you do print next time, enter your Windows user details and password. If XP has no password then set one - it is bad practise to have a Windows computer without a password. And updates to Mac OS X expect you to have one set in the Windows computer.
    If for some reason you don't want to set a password in XP then enable the Guest account and you can use this on the Mac when you get the prompt (either select Guest or type it in).

Maybe you are looking for

  • Scrollbar in a Dialog

    Hello, referred to the Adobe Toolscript PDF I tried to add an scrollbar to my dialog. I dont clearly understand how this works. In my snippet the scroll is added to the dialog but I cant manage to add content to it. Hopefully someone here can help me

  • Can i use apple computer to place phone call?

    can i use apple computer to place a phpne call?

  • Limitations while conected HANA universe to design studio

    Hi All, Previously i have created number of dashboard reports in Design Studio using BEx quires. Recently we moved to HANA database. From HANA we have universe connected to Design studio. Here we are facing some problems. It is not accepting huge dat

  • BMM & PRESETATION( newbie)

    1) explain how aggregate tables work. 2)explain how to setup level-based measures. 3)how to create multiple hierarchies for the same dimension. 4) can you change the presentation column name in the presentation layer? 5) How to categorize the folders

  • Flash Player quit working

    I use a PPC iMac with system 10.5.8. Recently Flash quit working and I am having trouble finding the proper download for a non-Intel Mac. AS a result, most videos will not play. Any suggestions?