It is used to view the precise commands that were sent to QuarkXPress or InDesign, and messages received from QuarkXPress or InDesign, during the most recent diary generation.
This tool is mostly used by our development team.
But it can also be of use to end-users in the following cases:
•A token is not converted the way you expect. Viewing the p-Code allows you to determine if the token processing you expected was indeed sent to QuarkXPress or InDesign. If not, then you may have misunderstood the behavior of a particular token, or there may be a bug in the code that generates the p-Code.
•QuarkXPress or InDesign crashes at a particular point of the token processing step of diary generation. Using the keep log of errors and the activity log it generates, you can pinpoint the page and object number that caused the crash and view what token processing QuarkXPress or InDesign was attempting before it crashed.
The p-Code Viewer window is made up of 3 main parts; the list of p-Code instructions on the left, the details of the current instruction processing in the center, and the origin of the current instruction on the right.
•The Diary Page column refers to the page number of the output file.
•The Template ID column refers to the ID of the template that this page uses.
•The Page of Template column refers to which page of the template contained the textbox which generated the instruction.
•The Obj. ID column refers to the ID of the textbox in the template.
•The Action column displays the action property ID, as it is being supplied to QuarkXPress or InDesign, as well as a textual description of what that action corresponds to.
Using that data grid, you can:
•Click on one or more column headers to sort the list of instructions.
•Use the filter row to filter by page, template, object or action.
•Use the Customize button to perform advanced filtering.
•Drag one or more column headers to group by one or more criteria.
•Use the Find button to find text across all fields of the table, including the contents of the original textbox where the token that generated a given instruction is.
➢This can be useful, for example, to display only p-Code instructions related to a specific layer ID or group ID, or anchor box, or InDesign table, as shown in the examples below.
When you select one of the p-Code instructions, the rest of the p-Code Viewer is updated to display the details of the current instruction processing in the center, and the origin of the current instruction on the right.
The central part of the of the p-Code Viewer displays the details of the current instruction processing.
But, sometimes, if a token involves complex format change, you will see 2 actions.
As shown in the example below, one action entry replaces the text and the other then applies formatting (font, size, color, ...) to the already once processed textbox:
In the above example, the first action replaces text in the entire textbox, placing tags (such as **MOON** and **PHASE**) to indicate where further processing is to occur. The second line then isolates the text delimited by the **MOON** tags and applies some specific formatting (changing the font to a symbol font that shows Moon phases, in the present case).
➢Note that section is only displayed if there are run-time messages or sara hits related to the currently-selected p-Code instruction.
These run-time messages and saras hits will also be available for detailed viewing in the and which will also be available in the diary generation messages dialog and the saras hits dialog, respectively.
Note that, as is the case for the diary generation messages dialog, and the saras hits dialog, you can return and view the p-Code from the most recent diary generation, by selecting the debug menu from the main window.
The topic on native text formatting describes the various parameters used in the p-Code Instructions section.
Its contents are the same as those of the Tokens Conversion section described above, and it is rare that viewing this section would be necessary and would bring anything more than can be seen, more conveniently, in the Tokens Conversion section.
The only case when it is useful to look at the contents of the p-Code Instructions section is when the order in which the tokens are presented to QuarkXPress or InDesign is important, such as would arise when message 108509 is issued during diary generation, requiring the use of the multi-pass token replacement diary generation option.
On the right of the p-Code Viewer, is displayed additional information about the textbox origin of the currently selected instruction.
The Original Object's Content, located at the top right of the p-Code Viewer, displays the text contents of the textbox containing the token whose processing generated the currently selected instruction.
But, additionally, as shown in the example above, it also displays:
•The ID of the layer on which that textbox is placed.
•The ID of any group to which that textbox might belong.
•The ID of any box into which the current textbox might be anchored.
•The ID of the box containing the master table cell, if the current textbox is a table cell.
The above are extremely useful if you want to display only p-Code instructions related to a specific layer, group, anchor box, or table.
Template Page Preview
At the bottom right of the p-Code Viewer you will find a preview of the scanned template's page corresponding to the textbox containing the token whose processing generated the currently selected instruction.
Topic 108047, last updated on 27-Jan-2023