in

Quark Forums

All boxes print to postscript, but the Application unexcepted quit

Last post 06-04-2008 8:42 AM by rexleung. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-04-2008 12:53 AM

    All boxes print to postscript, but the Application unexcepted quit

    I need to AutoPrint Postscript file by every generic box , but I  can't output all generic box ps file. The QuarkXPress software is alway unexcepted quit or error -48 . 

    // Start Coding 

    on run

        set _strStoragePath to (choose file as string) 

        tell application "QuarkXPress 4.1TC"

            tell document 1

                copy name to _docname

                set _GenBoxTotal to (count of generic box)

                tell print setup

                    // Some print setup properties setting

                   set printer type to "Generic Imagesetter"

                end tell

                // Set all box to Suppress printing first

                repeat with from _BoxNum = 1 to _GenBoxTotal

                    tell generic box _BoxNum

                        set suppress printing to true

                    end tell

                end repeat

            end tell

            // Set every generic box print to PS file

            repeat with from _BoxID from 1 to _GenBoxTotal

                if _BoxID > 1 then set suppress printing of generic box (_BoxID - 1) of document 1 to true

                set suppress printing of generic box _BoxID of document 1 to false

                set _SaveFullPath to ( _strStoragePath  & _docname & "." & _BoxID & ".ps" as string )

                1. Print document 1 PostScript file file _SaveFullPath

                2. Print document 1 PostScript file _SaveFullPath

                3.  Print document 1 PostScript file ( _strStoragePath  & _docname & "." & _BoxID & ".ps" as string  )

            end repeat 

        end tell

    end run

    // End Coding 

    I try the syntax 1. Or 2. Or 3 ,  The QuarkXPress is unexcepted quit when _BoxID variables looping to 2. Only one file '<document>.1.ps' can be print.   I want to know How to fix it problem.

     

    My Computer Config

    MacOS 8.1 + QuarkXPress 4.1CT

    Filed under:
  • 06-04-2008 2:08 AM In reply to

    Re: All boxes print to postscript, but the Application unexcepted quit

    Error -48 means the PS file already exists - so you could try to delete existing file before printing a new one: that's the easy answer indeed.

    Something that would prevent most duplicated file names is the use of the box uniqueID instead of its index in document - to name the new PS files.

    This being said - I am not sure this will really help you much: QXP is not crashing when you've got a duplicated file name because it's not going to print it in such a case - that's probably what's saving you from a crash in this case.

    When there was no duplicated file then it goes to print and crashes - correct? 

    It would be interesting to know where these duplicated files are coming from in the first place - if they were created in a previous PS output process before QXP crashed or if they where already there by mistake.

    Anyway - I doubt this is a syntax problem in your "print" statement - assuming QXP TC is handling double bytes file names (etc) correctly during PS output.

    At first I would try to simplify this printing process to a single doc output to make sure you can print one alone without a crash on this precise configuration of yours.

    Then I would try to print several - and this is probably where your troubles are going to start: be aware that you can't print several documents at the same time - you have to wait first document output was successfully completed before you can fire the next one.

    Firing them like a machine gun is usely leading to a crash: you have to understand you are sending a printing thread to the system every times you do a "print" statement - and that the system printing is actually controled by a printing driver.

    Therefore if your printing driver is not able to queue the print *orders* it receives from the QXP application in a row then it will be quickly overloaded and would most certainly kill current printing thread before completion - leading to a crash in QXP - which is the actual printing thread owner.

    I hope this will make sense to you - I don't have a scripting solution as I am used to handle this kind of issue by XTension programming. But I would be interested to know how this could be done by scripting as well indeed - assuming I was seing your problem correctly from a crystal ball. . .

    - - -
    http://homepage.mac.com/p.perroud/
  • 06-04-2008 8:42 AM In reply to

    Re: All boxes print to postscript, but the Application unexcepted quit

    Thank you for your comments, the use of 'print postscript file' applescript command, background printing as the default. When the print document, in fact behind the output data also continued to ps file, it appears the situation. If the print after the completion of the Desktop Printer Manager , will continue to keep print every box to ps file.
    Filed under:
Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems