Page object

Hi all,
I've just started messing with InDesign scripting, and being a web developer I've obviously chosen to go with Javascript as my scripting language.  I had been reading through the available literature and thought I had pretty much figured out the DOM, and writing the script I was after.
The idea is, I've got 4 columns when the data flows top to bottom, left to right.  The function I wrote was supposed to add a textFrame to a page after first calculating how many frames are already on this page.  If it already contains 4 textFrames then it creates a new page, then puts the textFrame on that page.
The issue I'm facing is that it works fine for page 1, and page 2... but when it adds a page to a spread (in this case, page 3), the page object returned (even when access the last page of the document independently app.activeDocument.pages[-1]), it is return the page 2 object... so putting the textFrame on this page.
Below is my code.
function addTextFrame()
    var page = app.activeDocument.pages[-1];
    var thisPageFrames = page.textFrames.length;
    var columns = 4;
    if ( thisPageFrames == columns) {
        page = app.activeDocument.pages.add();
        thisPageFrames = 0;
    var thisFrame = thisPageFrames + 1;
    var leftMargin = page.marginPreferences.left;
    var rightMargin = page.marginPreferences.right;
    var topMargin = page.marginPreferences.top;
    var bottomMargin = page.marginPreferences.bottom;
    var pageHeight = app.activeDocument.documentPreferences.pageHeight;
    var pageWidth = app.activeDocument.documentPreferences.pageWidth;
    var frameHeight = pageHeight - topMargin - bottomMargin;
    var frameWidth = (pageWidth - leftMargin - rightMargin) / columns;
    var frameRight = (thisFrame * frameWidth) + leftMargin;
    var frameBottom = frameHeight + topMargin;
    var frameTop = topMargin;
    var frameLeft = leftMargin;
    if (thisPageFrames != 0) {
        frameLeft += (thisPageFrames) * frameWidth;
    var newFrame = page.textFrames.add();
    newFrame.geometricBounds = [frameTop, frameLeft, frameBottom, frameRight];
    return page;
addTextFrame();
Any advice you can provide would help me soooo very much.

I've got a further question... of course.
These XML documents will be served from a web server.  To ensure that people don't have multiple copies of these files on their machines, I've attempted to set up a script that will automatically import the XML document from a given URL each time it is activated.
I'm able to manually open the file by using: -
var xmlFile = File('Path/to/file.xml');
However, doing the same with a URI in place of the local path returns nothing.
var xmlFile = File('http://www.path.com/to/yourXML.xml');
Any ideas?

Similar Messages

  • Everytime I copy pages from one ID CS3 doc to another, it re-applies the master page objects!!

    Please Help,
    This is a topic I would really like to get to the bottom of.
    We have InDesign CS3 templates for creating our reports.
    These templates contain around 10 different master pages with grey placeholder image boxes and text boxes with dummy text.
    When we copy pages from one ID document to another, all the master page objects that were originally assigned to the pages are re-applied!!
    Resulting in lots of grey dummy boxes and text boxes re-appearing on top of the page items!!
    It's so annoying because we always customise the pages once we've pulled down master pages to work on, so when we copy pages across to other documents we have to apply the blank master to be able to kick out all the master objects easily.  Then we need to add the page numbers and footers back onto the blank master page.
    My question is, is there a way to switch this off, so when I move or copy pages from one document to another, nothing happens relating to master page objects, the pages simply just copy across as they are?
    Please help!  If not I may have to ask an external developer to write a script to fix this, it drives 900 of us crazy!
    thanks in advance for any help.
    Or am I just being ridiculous and not actually realising you can switch this off, doh!
    G

    Just a bit of further clarification on this issue (very few people really understand what's going on with master pages and overridden master page items):
    When you override a master page item, the object is moved to a local page, but a connection is maintained with the original master page item. This a) allows for the override to be removed (and return the object to its original state). This also, b) allows for changes made to the original master page item (other than the changes made to the local item from the point that it was overridden) to effect the local item as well.
    When the connection to the master page item cannot be maintained, the local item gets disconnected totally from the master page, and becomes a regular, run-of-the-mill page item.
    In light of this, there's three ways you can end up with duplicate master items:
    Reapplying a master page (or applying a new one). When you reapply a master, all overridden master page items get detached from the master, and the original mster page item appears again in its original state. Most of the time this produces unwanted duplication of objects. To fix up your page, you have two options: a) Delete the master page item, and b) copying the contents of the original to the new master page item. The disadvantage of "a" is that you end up with an item which is totally detached from the master, and changing the item on the master will have no effect on the local item. The disadavantage of "b" is that it's a lot of work...
    Moving a page to a different document. When you move a page to a different document which has the same master as the one originally applied, the master in the new doc is applied, and the effects are identical to reapplying a master page (i.e. overridden objects are detached). If the applied master (i.e. a master with the same name) does not exist in the new doc, the master is transferred over to the new doc along with the page, and the connections to the master page are preserved (well, re-created actually...). The workarounds in case #1 apply here as well.
    When page sides change in a document, the objects on the facing page appears.
    What happens here is a bit confusing, but here's an approximate explanation:
    When you apply a master to a page or spread in InDesign, what you are actually doing is applying an entire spread to an individual page. You can thing of a master spread as an overlay (or more precisely: underlay) on the page with a window cut out to the exact page dimensions.
    When the page side changes that "window cut-out" shifts to show the master spread items which correspond to the position within the spread of your current page (i.e. recto or verso). All objects which exist outside the window shift out of view (but still exist!).
    When an object is overridden, the position of the object is defined by its location on the local page, NOT its position on the master spread. When the page then changes sides, the object remains where it was on the page (even though the object it's connected to on the master spread moves out of the window of view). A corresponding object on the facing page of the master (if it exists) will then show in addition to the overridden one.
    Now remember: contrary to the first two cases, both objects are based on master ones: one visible one and one invisible one.
    Dealing with this third case requires much more care than the first two.
    The obvious way to deal with this would be similar to the first two, but if you remove the local object and transfer the content to the new maste object, the invisible master object on the non-visible page was actually removed, so when the page sides change again, the object will now be connected to the now-invisible master page item, and the correct master page item will be gone!
    The "correct" way to deal with this would be to transfer the content to the new master page item and remove overrides (not delete!) on the local item (which will make it disappear, because it moves back to the invisible page). Of course, when page sides change again, it becomes necessary to repeat the entire process.
    If the local object gets deleted, then your master spread is missing objects with no visible indicator of the fact. This can lead to confusion when the document might be edited at some later point in time.
    I believe that this complicated and un-intuitive behavior of master pages is part of the reason people tend to avoid using master page items. Documents tend to get messed up in really odd ways... It's a real shame, because extensive use of master page items has a lot of potential for streamlining workflows and saving an awful lot of time. This behavior really puts a damper on really using master pages as templates.
    Getting master page items to work the way they "should" was a big part of what I was trying to accomplish with AutoFlow Pro... When the master page items are defined as such (i.e. given a unique name), AutoFlow Pro solves all three of the above issues by keeping overridden master page items connected to the master page items on the currently applied master (and when a new master is applied as well!).
    (When I have a bit of spare time, I think I'll write this up on my blog with some visuals to make this easier to grasp...)
    Harbs

  • InDesign Master Pages; complication with re-appearing master page objects

    Hi everybody!
    A short intro to understand the problem: I'm working on a commemorative journal for a dinner that people are submitting text based ads to little by little. The types of ads are divided into different chapters so I made different master page spreads for each section. The ads need to be in alphabetical order so as they come in, I add new pages into the layout and place the ad text into the text box.
    Here is the basic structure of my master spreads: there is a text box on each side of the spread that contains an anchored object. I'm using that object as a separator to separate between the ad text and the name of the person who placed the ad. When I insert the ad text, I'm releasing the text box master object and I'm inserting and formatting the text.
    Here's the problem: when I add pages to the layout and the pages already in my layout shuffle, in some instances the text box with the anchored object re-appears behind what I've already done through the text (the anchored object is a dotted line so there ends up being a dotted line through the middle of the text). For example, if I have master page A applied to page 3 (right side of spread), when I add a page before 3 (making page 3 into page 4 and a left side of spread), the master object text box containing the anchored object appears behind the one that was the original master object that I released and inserted text into.
    I did some experimenting and I found that this only happens when I add an odd number of pages. When I add an even number of pages, the additional master page object doesn’t appear. Also, if I add one page after adding a page, the extra master object disappears. I'm assuming that this is because when I add an odd amount of pages the spread with my text switches sides and the master object from the other side of the spread is appearing. Also, if I manually remove the new master object that appears, a new master object does not appear if I shuffle it again.
    Solutions I came up with were either just manually going through the document at the end of the project and removing the extra master objects or applying a white background to the text box so that it would the block the new master object that appears. However, I think there has to be a better solution would be more automatic, leaving less room for human error and being less sloppy that giving white backgrounds to all the text boxes.
    In short, I think the problem is that when my pages are being switched to the opposite side of the spread it is adding the master objects of the side of the spread it switched to. So would there be a way to prevent that from happening?
    Looking forward to what you guys think.

    In short, I think the problem is that when my pages are being switched to the opposite side of the spread it is adding the master objects of the side of the spread it switched to. So would there be a way to prevent that from happening?
    That is correct behavior. You could stop using master page objects. Instead, make your anchored frames into a snippet or a library object so that you can drag and drop the thing onto a fresh page for that next arriving ad. I would make the master pages show only grid lines and margin and column guides.
    If in CS6, and you are on the master pages, and you designate the selected frame as Primary Text frame, then that might not happen (if I understand your description, which I sorta don't)

  • Master page objects misbehaving

    I'm working on a booklet for my company, and have run into quite an annoying and baffling problem. I'm using master pages for the templated parts of the layout, and am trying to edit what I've designated as the section heading for each page. On the left page, this works swimmingly:
    However, on the right page, it instead selects the object beneath the text box that I want to select:
    Yes, I am clicking directly on the text box - to no avail.
    Any idea how to fix this?

    You cannot just click on a master page object to select it on the document page. You must Cmd (Ctrl) + Shift click to override it first. If you did that to the wrong frame, it wound up in front of the one remaining on the master page, effectively hiding it from you. Remove the selected override for that object.

  • Master Page objects

    Bob, I can't find my previous thread, I don't even remember its name. So I am opening a new one, hope I'm not close to spamming by doing this. I had some problems with the objects on the master page, they didn't come out when exporting to PDF. Well, I somehow fixed it, I don't know exactly how, but I think there was another object in front of it, that became visible only on the PDF, covering my object. Maybe you can better guess what happened cause I surely can't.
    As I've already opened a new topic, I'll use this opportunity to ask if there is any possibility to activate the objects placed on the master pages from aleatory pages of the document. I mean, if I want to bring forth a master page object on let's say page 5 and place it on top of something else, but leave the other master page objects where they were, can I do that? Or do I have to apply None on page 5 instead of Master Page, and copy the object from the master and place it on the page I'm working in.
    Hope I didn't piffle to much and was clear enough.

    all objects from MasterPages as always placed beneath of objects placed directly on regular Page from the same Layer
    if you need to bring some object placed on MasterPage above object(s) on regular page - you need to click SHIFT+CTRL+LeftMouseButton on this object and override it on current page
    robin
    www.adobescripts.com

  • XMP property for a page object not predefined and no extension schema...

    In attempting to make PDF/A-1b files, I get the Preflight error "XMP property for a page object not predefined and no extension schema present."
    Every page reports the same Trigger values:
    => Property exists in predefined schema (XMP 2004): is not true
    => Extension schema is present in XMP: is not true
    By following the suggestions in the Acrobat 9 Help page "Edit document metadata" I can save existing metadata to an external .xmp file, but I cannot change the XMP metadata to solve the Preflight error.
    I would be grateful for suggestions re how to solve the Preflight error.
    Thanks,
    Raphael

    There is still that same problem.
    Pictures what needed to converted tot PDF/A
    My situation is large JPEG's.
    My workaround to print it out with adobe pdf printer with the options
    1) papiersource on base of pageformat PDF
    2) If needed use adjusted paperformat

  • Haw to restore deleted master page object

    If I apply Master Page to some page an then override and delete some object which originates on master page - is there any way to bring it back again with scripting?
    I'd like to avoid reapplying Master Page  - becuse I don't wat to reset overridden attributes other master page objects.

    Most properties can be stored and applied using the "properties" property.
    Depending on the content type, you will need to handle it differently. FWIW, here's some code that will apply properties from one text frame to another. For content you would need to either move/copy the text or thread the frame.
    function applyProperties(origin,target){
        target.appliedObjectStyle=origin.appliedObjectStyle;
        target.properties = GetTextFrameProperties(origin)
        target.textFramePreferences.properties=origin.textFramePreferences.properties;
        target.textWrapPreferences.properties = origin.textWrapPreferences.properties;
    function GetTextFrameProperties(frame){
        var frameProps = frame.properties;
        var e;
        //frame = frame.properties;
        var properties = {}
        for( var x in frameProps){
            switch (x){
                //case
            //appliedObjectStyle:frame.appliedObjectStyle,
    //~        contentType:frame.contentType,
                case "cornerRadius":properties.cornerRadius = frameProps.cornerRadius;break;
                case "fillColor": properties.fillColor  = frameProps.fillColor;break;
                case "fillTint": properties.fillTint = frameProps.fillTint;break;
                case "gapColor": properties.gapColor = frameProps.gapColor;break;
                case "gapTint": properties.gapTint = frameProps.gapTint;break;
                case "horizontalScale": properties.horizontalScale = frameProps.horizontalScale;break;
                case "itemLayer": properties.itemLayer = frameProps.itemLayer;break;
                case "label": properties.label = frameProps.label;break;
                case "rotationAngle": properties.rotationAngle = frameProps.rotationAngle;break;
                case "shearAngle": properties.shearAngle = frameProps.shearAngle;break;
                case "strokeAlignment": properties.strokeAlignment = frameProps.strokeAlignment;break;
                case "strokeColor": properties.strokeColor = frameProps.strokeColor;break;
                case "strokeTint": properties.strokeTint = frameProps.strokeTint;break;
                case "strokeType": properties.strokeType = frameProps.strokeType;break;
                case "strokeWeight": properties.strokeWeight = frameProps.strokeWeight;break;
                //textWrapPreferences: properties.frameProps.
                case "verticalScale": properties.verticalScale = frameProps.verticalScalebreak;
                case "allowOverrides": properties.allowOverrides=frameProps.allowOverrides;break;
                case "absoluteHorizontalScale": properties.absoluteHorizontalScale=frameProps.absoluteHorizontalScale;break;
                case "absoluteRotationAngle": properties.absoluteRotationAngle=frameProps.absoluteRotationAngle;break;
                case "absoluteShearAngle": properties.absoluteShearAngle=frameProps.absoluteShearAngle;break;
                case "absoluteVerticalScale": properties.absoluteVerticalScale=frameProps.absoluteVerticalScale;break;
                case "dataStore": properties.dataStore=frameProps.dataStore;break;
                case "endCap": properties.endCap=frameProps.endCap;break;
                case "endJoin": properties.endJoin=frameProps.endJoin;break;
                case "gradientFillAngle": properties.gradientFillAngle=frameProps.gradientFillAngle;break;
                case "gradientFillLength": properties.gradientFillLength=frameProps.gradientFillLength;break;
                case "gradientFillStart": properties.gradientFillStart=frameProps.gradientFillStart;break;
                case "gradientStrokeAngle": properties.gradientStrokeAngle=frameProps.gradientStrokeAngle;break;
                case "gradientStrokeLength": properties.gradientStrokeLength=frameProps.gradientStrokeLength;break;
                case "gradientStrokeStart": properties.gradientStrokeStart=frameProps.gradientStrokeStart;break;
                case "javascript": properties.javascript=frameProps.javascript;break;
                case "leftLineEnd": properties.leftLineEnd=frameProps.leftLineEnd;break;
                case "localDisplaySetting": properties.localDisplaySetting=frameProps.localDisplaySetting;break;
                //properties.locked=frameProps.locked;
                case "miterLimit": properties.miterLimit=frameProps.miterLimit;break;
                case "nonprinting": properties.nonprinting=frameProps.nonprinting;break;
                case "overprintFill": properties.overprintFill=frameProps.overprintFill;break;
                case "overprintGap": properties.overprintGap=frameProps.overprintGap;break;
                case "overprintStroke": properties.overprintStroke=frameProps.overprintStroke;break;
                case "rightLineEnd": properties.rightLineEnd=frameProps.rightLineEnd;break;
                case "strokeCornerAdjustment": properties.strokeCornerAdjustment=frameProps.strokeCornerAdjustment;break;
                case "strokeDashAndGap": properties.strokeDashAndGap=frameProps.strokeDashAndGap;break;
                case "cornerEffect": properties.cornerEffect = frameProps.cornerEffect;break;
                case "featherCornerType": properties.featherCornerType = frameProps.featherCornerType;break;
                case "featherMode": properties.featherMode = frameProps.featherMode;break;
                case "featherNoise": properties.featherNoise = frameProps.featherNoise;break;
                case "featherWidth": properties.featherWidth = frameProps.featherWidth;break;
                case "isolateBlending": properties.isolateBlending = frameProps.isolateBlending;break;
                case "nonprinting": properties.nonprinting = frameProps.nonprinting;break;
                case "opacity": properties.opacity = frameProps.opacity;break;
                case "shadowOpacity": properties.shadowOpacity = frameProps.shadowOpacity;break;
                case "shadowSpread": properties.shadowSpread = frameProps.shadowSpread;break;
                case "shadowXOffset": properties.shadowXOffset = frameProps.shadowXOffset;break;
                case "shadowYOffset": properties.shadowYOffset = frameProps.shadowYOffset;break;
                case "cornerOption": properties.cornerOption = frameProps.cornerOption;break;
                case "flip": properties.flip = frameProps.flip;break;
                case "absoluteFlip": properties.absoluteFlip = frameProps.absoluteFlip;break;
        return properties;
    Harbs

  • Master page objects with drop shadows crossing over spreads

    Mac 10.5.4 - INDesign CS3
    I have a book file that is giving me a pretty hard time. There are several master page spreads that do not show as spreads in the book file. The left page from one set of masters with the right page from another set. There is a grouped row of circles that has drop shadow applied that appears on several master spreads. This is built as two groups that meet in the gutter to give the appearance of a row all the way across the spread. When the group is on the gutter between the two pages of the master spread, The object will show up on the both pages of the book spread, on top of the data from the left page master. If we shut off the drop shadow, no problem. If we move the group 0p5 away from the gutter no problem. The problem is that in the end we want this element to have a drop shadow and to run into the gutter.
    Does InDesign count the spread of the object effect as part of the object itself? That seems like what is happening. Is there a fix (work around) for this?

    The easiest workaround I know of is to paste the object with the drop shadow inside another box such that you can clip it at the gutter. We've cursed this "feature" for years.

  • Remove details for web page object types in search results

    Within the search results, the first 200 characters are displayed for documents, web pages, etc.. Web pages show the HTML code. Is there a way to hide these details for web pages but have them visible for all other object types?

    The solution can be found in this thread: http://discussions.apple.com/thread.jspa?threadID=2456976
    Download Secrets at http://secrets.blacktree.com/
    Install the prefspane, select Safari in the left hand list, and uncheck "Use new URL completion list".
    You need to log out and log in again for it to work.

  • Can't select Master Page object on document page.

    Hi,
    Yes, I know this question has been asked a million times. But, it's just not working for me. I've got a simple green box at the bottom right of my master page. I've made it into a button. I've allowed the master page to overwrite. But, on my document pages I simply cannot select this object. I've made the object into a button, per the master page, and, I need to have it link from each page back to a previous page in the document. Yes, I've tried Cmd + Shift, then click on the object, but, that doesn't work.
    My button shares space with a page text box. Those are the only objects on the page, though. If I move the text box up, then yes, I can select the button. But, that's cheating.
    Thanks a lot for any help.

    What do you mean shares space with? Is it on top of the button?
    If so, try locking it the text frame..
    Bob

  • Auto-number page objects from master pages

    Hello all! I'm trying to set up a photo contact sheet template in InDesign so that we can get rid of the one we're using in Word that's rather...clunky. The only caption underneath each photo will be a simple, basic number that increases sequentially. There are six photos per page. I dove into numbered lists for the first time and figured out how to make the numbered captions work on the regular document pages, but I am trying to avoid creating the caption text box objects there because these contact sheets could be anywhere from 10-40 pages, and it's much easier to just create a slew of new pages from a master page.
    When I transfer the number captions to the master page, the numbers are correctly sequenced when a single new document page is created from that master...but any additional document pages have the same sequential numbers (e.g. 1-6)! Is there a way to get around this?

    Peter, without threading, the individual text boxes on the master page do number correctly. They are empty text boxes except for an invisible character such as a hard return, and once I have the invisible character in place, the numbers appear.
    Because 1-6 already number and appear correctly, it doesn't make sense to me to thread them together, although I did try it including from caption 6 back to caption 1...this resulted in caption 1 disappearing and all the other captions reducing by increments of one (1-5).
    I'm not sure if I'm 'placing' my list incorrectly (that term doesn't quite make sense to me ~ I thought you define a list and then apply it directly or through a paragraph style?) or what, but do you have any other suggestions?

  • EP5 exporting page object errors

    Hi,
    When I export a <b>PAGE </b>object, I get the below error
    <b><i>Export Results
    Exporting package C:\Enterprise Portal\DataFile\data\Export\package.pkg
    Error exporting page TestComp: Error in ExportalService download Page from Server: Connection refused: connect
    Export completed</i></b>
    Could some please give me explanation why this is erroring?  How to prevent this download and successfully download <b>PAGE </b>object?
    Thanks
    Siva

    Thank you for responding and the information, Scott. I used Document Setup and matched the height and width of the document to the bounding box of the grouped image and it worked perfectly.
    Thank you again.
    Barry

  • Pages: Object Placement problems

    I have, up till now, been able to combine photos (jpgs) with text on the same page, with Object Wrap functions. For some reason, it's not working.
    Under the Object Causes Wrap bar, I am allowed to pick and choose. However, under the Object Placement bar, I cannot select any of the options.
    I have an older version of Pages and I don't want to upgrade (for many reasons).
    Can anyone please help !  Look forward to hearing from you soon. Many thanks.  Don in California

    Mr. Seek Help wrote:
    …I have an older version of Pages…
    Do you think it would be useful to tell us what that is?
    Sounds to me like you have an Inline Object in a Textbox.
    Peter

  • Front Page Object Editor

    Hi,
    I have added frontpage add-in and under tools it is showing three options SAP xMII Object...,SAP xMII Configuration Menu....., SAP Script Assistant.....
    SAP Script assistant is working fine but SAP Object is opening but couldn't show any templets in the windows. When I clicked Login and entered username and password it could not connect to server all.
    I was wondering some where it is not getting which server it has to connect.
    Can some please tell me where to specify the server name in Object editor.
    Thanks,
    Srinivas.

    The standalone version does not use FrontPage server extensions, in fact only the FrontPage software itself uses the extensions to communicate to/from the IIS box.
    The fundamental difference between the standalone and embedded version is how they communicate with xMII for namespace browsing query and display objects.  The standalone prompts the user for machine name and port, whereas the embedded one uses the application title bar string from FrontPage itself to parse the server path, which is why
    server\c$ doesn't work, nor does F:\server\path - it needs http://servername:port or http://servername.  This only happens within FrontPage when you do either File...Open Site or File...Open Web (depending upon version) and physically type http://servername in the input box that shows up at the bottom of the dialog box.
    Once FrontPage connects to the webserver the application title bar will read something like "Microsoft FrontPage - http://servername:port" and the Folder List tree header will say "http://servername:port".  Then and only then will the embedded one work like you want it to.
    Regards,
    Jeremy

  • When doing a Compare, the window gets stuck on "comparing page objects"

    I have to kill the Adobe session in order to continue. 

    I may have a similar issue: Acrobat XI Pro Compare feature dialog boxes hang

Maybe you are looking for

  • Suggestion for a new book or resources

    Folks, The stuff I really find interesting is when Dan, Ravi, Albert and other start showing how to tweak SQL scripts to get some performance out of them. For example, the thread entitled: "Spatial Query with multiple geometries from 2 tables" It is

  • Help, an app page has frozen on my IPad Air!

    So this would be a bit confusing to understand. So I'm gonna explain everything clearly from the beginning. I was reading a story on my IPad Air with the app, Wattpad. When I wanted to exit, I pressed the home button, but then something just happened

  • Displaying query columns in page header

    I have a 6i report, breaking on department, which shows the current department code and name in the page header, using a page-level summary column. Problem: there are department-level summary data (e.g. totals) that are printed after the detail lines

  • Creating Software Update Packages - Best Practice?

    I am setting up our SCCM 2012 R2 environment to begin using it for Windows Updates, however I'm not sure 100% the best method of setting it up. Currently my plan is to break out the deployment packages by OS, but I read\told that I should avoid creat

  • Reg: Where can i write pcr in tm04 for night allowence

    Hi all, I got one requirement for payment for night shift allowance.Where exactly i can write a pcr for allowance and how do i evaluates with payroll. Thanks Laxmi