Not present that skip lines

Dear people,

Is it possible for InDesign to ignore the rules in the script if something is not present?

He tries to illustrate what I mean:

//Map the XML tags to the defined styles.
var myDocument = app.documents.item(0);

//Part 1.
myDocument.xmlImportMaps.add(myDocument.xmlTags.item("TAGNAME_1"),
myDocument.paragraphStyles.item("myparagraphStyle_1"));
myDocument.xmlImportMaps.add(myDocument.xmlTags.item("TAGNAME_2"),
myDocument.paragraphStyles.item("myparagraphStyle_2"));
myDocument.xmlImportMaps.add(myDocument.xmlTags.item("TAGNAME_3"),
myDocument.paragraphStyles.item("myparagraphStyle_3"));

//Part 2.
myDocument.xmlImportMaps.add(myDocument.xmlTags.item("TAGNAME_a1"),
myDocument.paragraphStyles.item("myparagraphStyle_1"));
myDocument.xmlImportMaps.add(myDocument.xmlTags.item("TAGNAME_a2"),
myDocument.paragraphStyles.item("myparagraphStyle_2"));
myDocument.xmlImportMaps.add(myDocument.xmlTags.item("TAGNAME_a3"),
myDocument.paragraphStyles.item("myparagraphStyle_3"));

//Map the XML tags to the defined styles.
myDocument.mapXMLTagsToStyles();

Part 2 is not present in the InDesign document, so the script returns an error that it can't find part 2.

It is possible to run the script like:

If part 1 and 2 is this go

If part 2 is NOT present ignore and continue.

Already thanks for the help!

Greetings from Holland!

Hello

Do you mean something like this (untested):

//Map the XML tags to the defined styles.
var myDocument = app.documents.item(0);

//Part 1.
myDocument.xmlImportMaps.add(myDocument.xmlTags.item("TAGNAME_1"),
myDocument.paragraphStyles.item("myparagraphStyle_1"));
myDocument.xmlImportMaps.add(myDocument.xmlTags.item("TAGNAME_2"),
myDocument.paragraphStyles.item("myparagraphStyle_2"));
myDocument.xmlImportMaps.add(myDocument.xmlTags.item("TAGNAME_3"),
myDocument.paragraphStyles.item("myparagraphStyle_3"));

//Part 2.
if(myDocument.xmlTags.item("TAGNAME_a1") != null)
{
     myDocument.xmlImportMaps.add(myDocument.xmlTags.item("TAGNAME_a1"),
     myDocument.paragraphStyles.item("myparagraphStyle_1"));
     myDocument.xmlImportMaps.add(myDocument.xmlTags.item("TAGNAME_a2"),
     myDocument.paragraphStyles.item("myparagraphStyle_2"));
     myDocument.xmlImportMaps.add(myDocument.xmlTags.item("TAGNAME_a3"),
     myDocument.paragraphStyles.item("myparagraphStyle_3"));
}

//Map the XML tags to the defined styles.
myDocument.mapXMLTagsToStyles();

Tags: InDesign

Similar Questions

  • I have problems with the form widget. When I created my forms, I need to leave out the line, one email because my client does not want the message line and two because those who have tried to fill the online form cannot submit because that box "email".

    I have problems with the form widget. When I created my forms, I need to leave out the line, one email because my client does not want the message line and two because those who have tried to fill the online form cannot submit because the 'email' box keep rejecting their email address valid. And I just tried to remove the line in my form and it does not allow me to delete or to mark it as not necessary either.

    Currently, there is no way around the field email forms of the Muse. Another option is to have a look at Jotforms or another third-party provider of shape that Muse has widgets for.

  • Refrencing objects that are not present on frame 1 of the movieclip

    Hello world!

    I work with a movieclip right now that has two frames in it.  I want the user to be able to go back and forth between pages by clicking on the tabs on each page.  They click on the button is present on the frame that it applies (so, the button to switch to the frame 2 is present on frame 1 and vice versa).

    I want to control when they are able to click back and be able to turn the buttons on and off whenever I need to, but given that the button to return to frame 1 is only on frame 2, when I reference the button fits as a null object from the main timeline.  How can I refrence an object that is not present on the first frame of a clip?

    Here's the gist of what I have.  The main timeline has an object called "mAccess" which has 2 frames, windows and on reports.  Upstairs, there are two tabs, one for Windows, one for reports.  The Windows tab is not clickable when on the frame (frame 2) reports and the reports tab is not clickable when on the chassis of windows (part 1)

    Main timeline:

    mAccess.bReports.addEventListener (MouseEvent.CLICK, gotoreportstab);

    function gotoreportstab(event:MouseEvent) {}

    mAccess.gotoAndStop (2);

    }

    mAccess.bWindows.addEventListener (MouseEvent.CLICK, gotowindowstab);           <-it gives me the error on the null object reference

    function gotowindowstab(event:MouseEvent) {since Windows does not exist on frame 1 of the mAccess.

    mAccess.gotoAndStop (1);

    }

    Thanks for you help with anything that can give me!

    the background is that you can not refer to an object that does not exist (yet).  the best workaround is to ensure that your object exists on the frames where you reference it.  the object does not need to be visible so it's not much extra work.  You can add and remove the object from the displaylist, as you see fit or activate and deactivate its visible property.

  • My printer is skip lines to print documents from my pc but the coppying works

    As the topic says my printer is skip lines when I try to print the document from my pc, but coppying documents while the printer is not connected to the pc works perfectly so I would appreciate your help to solve my problem.

    P.S. I tried Kaleidoscope twice but it does no effect whatsoever, I am using hp Deskjet 2050 J510 series

    This is not usually a symptom of software or programs.  If the ink levels are not accurate in the software of the printer it still would not affect the print quality of which is (the technology is unpredictable sometimes though).

    Try a hard reset of the printer, although it is still on and shut down the computer.  When all the powers on back, do a test print.  If printing still only all other lines, follow the document below from four Solution.  Solution Six shows you how to print a test page which will give you a more accurate account of the ink levels.  Once that prints, please tell me what it displays in the form of ink levels and if it shows any other signs of defects.

    -Solving print quality problems.

    If none of the suggestions has improved, how long is the USB cord and how old is it?

  • Finder - content issue not presented

    I had a problem with the finder long even with the Mavericks and now with v10.11.1 El Capitan

    I don't know what's happening that this occurs, but I am sure it starts happening after a while that my Mac is started (I restart not often, but every time I do that bug fix this issue, also restart the Finder).

    The problem is that I'm not able to see the content in the Finder, unless I have switch to another tab and return to the previous tab.

    1. the present proceedings is a diagnostic test. It doesn't change anything for the better or worse and therefore, by itself, will not solve the problem. But with the help of the results of the tests, the solution may take a few minutes, instead of hours or days.

    The test works on OS X 10.7 ("Lion") and later versions. I do not recommend running it on older versions of Mac OS X. It will do no harm, but it will not do not much good.

    Do not be put off by the complexity of these instructions. The process is much less complicated than the description. You make the tasks more complicated with the computer all the time.

    2. If you have already a current backup backup all data before doing anything else. The backup is needed on the general principle, not because of what anyone in the test procedure. Backup is always a must, and when you encounter any kind of problems with the computer, you can be more than the usual loss of data, if you follow these instructions or risk not.

    There are ways to back up a computer that is not fully functional. Ask if you need advice.

    3 here is instructions to run a UNIX shell script, a type of program. As I wrote above, it doesn't change anything. It does not send or receive data over the network. There is no to generate a report on the State of the computer human readable. This report goes nowhere unless you choose to share it. If you prefer, you can act on it yourself without disclosing the contents for me or someone else.

    You should ask yourself if you can believe me, and if it is safe to run a program at the request of a foreign national. In general, no, he's not sure, and I encourage it.

    In this case, however, there are ways for you to decide if the program is safe without having to trust me. First of all, you can read it. Unlike an application that download you and click to start, it is transparent, so any person with the required competence can check what it does.

    You may not be able to understand the script yourself. But variations of it have been posted on this site of thousands of times over a period of years. The site is hosted by Apple, which does not allow it to be used to distribute harmful software. One of the million registered users to have read the script and set off the alarm if it was dangerous. Then I wouldn't be here now, and you would not be reading this message. See, e.g., this discussion.

    Another indication that the test is safe in this threadand this onecan be found, for example, where the comment in which I suggested it was recommended by one of the specialists of the communityApple, as explained here.

    However, if you cannot satisfy yourself that these instructions are safe, do not follow them. Ask other solutions.

    4. here is a general summary of what you need to do, if you decide to go forward:

    ☞ Copy a particular line of text to the Clipboard.

    ☞ Paste into the window to another application.

    ☞ Wait for the test to run. It usually takes a few minutes.

    ☞ Stick the results, which will be copied automatically, in a response on this page.

    These are not specific instructions; just a glimpse. The details are in parts 7 and 8 of this comment. The sequence is: copy, paste, wait and paste it again. You don't need to copy a second time.

    5. try to test in conditions that replicate the problem, to the extent possible. For example, if the computer is slow intermittently, run the test during a downturn.

    You may have started up in safe mode. If the system is now in safe mode and works pretty well in normal mode to test run, restart as usual before running it. If you can test only in safe mode, this.

    6. If you have more than one user and a user is affected by the problem, and the user is not an administrator, and then run the test twice: once under the affected user and one administrator. The results can be different. The user that is created automatically on a new computer, when you start it for the first time is an administrator. If you are unable to log in as an administrator, verify that the user concerned. More personal Mac have only one user, and in this case this section does not apply. Don't log in as root.

    7 load the linked web page (the site "Pastebin.") The title of the page is 'Diagnostic Test'. Under the title is a text box, headed by three small icons. The right one represents a Clipboard. Click on this icon to select the text, then copy to the Clipboard of your computer by pressing Control-C key combination.

    If the text is not highlighted when you click the icon, select it in triple - click anywhere inside the box. Do not select the whole page, just the text in the box.

    8. start the Terminal application integrated in one of the following ways:

    ☞ Enter the first letters of his name in a Spotlight search. Select from the results (it should be at the top).

    ☞ In the Finder, select go utilities ▹ of menu bar or press the combination of keys shift-command-U. The application is in the folder that opens.

    ☞ Open LaunchPad and start typing the name.

    Click anywhere in the Terminal window to activate it. Paste from the Clipboard into the window by pressing Command + V, then press return. The text that you pasted should disappear immediately.

    9. If you see an error message in the Terminal as "Syntax error" or "Event not found", enter

    exec bash

    and press return. Then paste the script again.

    10. If you logged in as an administrator, you will be prompted for your login password. Nothing displayed when you type. You won't see the usual points instead of the characters typed. Make sure that caps lock is turned off. Type carefully, and then press return. You can get a warning to be careful. If you make three unsuccessful attempts to enter the password, the test is still running, but it will produce less information. If you do not know the password, or if you prefer not to enter, just press back three times at the password prompt. Yet once again, the script will run.

    If the test takes much longer that usual to run because the computer is very slow, you can be prompted for your password a second time. The permission you grant by entering it will expire automatically after five minutes.

    If you are not logged as an administrator, you will be prompted for a password. The test will run. It just will not do anything that requires administrator privileges.

    11. the test may take a few minutes to run, depending on the number of files you have and the speed of the computer. A computer that is abnormally slow may take more time to run the test. During execution, a series of lines is displayed in the Terminal window like this:

    [Process started]
            Part 1 of 4 done at … sec        …        Part 4 of 4 done at … sec
            The test results are on the Clipboard.
            Please close this window.
    [Process completed]

    The intervals between the parties will not be exactly the same, but they give an approximate indication of progress.

    Wait for the final "Process complete" message. If you don't see it in about 15 minutes, the test probably won't be all within a reasonable time. In this case, press the Ctrl + C key combination or the point command to stop it. Then go to the next step. You will have incomplete results, but still something. If you close the window of the Terminal, while the test is still running, the partial results will not be saved and you have to start over.

    12. when the test is finished, or if you have stopped it because it was taking too long, leaving the Terminal. The results have been saved to the Clipboard automatically. They do not appear in the Terminal window. Please do not copy from there. All you have to do is start a response to this comment and then paste it again by pressing Command-V.

    At the top of the results, there will be a line that begins with the words «Start time.» If you do not see, but rather to see a mass of gibberish, you don't expect the "Completed" message is displayed in the Terminal window. Please wait and try again.

    If personal information, such as your name or e-mail address, appear in the results, make anonymous before posting. Usually it will be not necessary.

    13. in the validation of the results, you see an error message on the web page: "you have included content in your post that is not allowed", or "the message contains invalid characters." It's a bug in the software which manages this website. Thanks for posting the results of the tests on Pastebin, then post here a link to the page you created.

    If you have an account on Pastebin, please do not select private in exposure menu to paste on the page, because no one else that you will be able to see it.

    14. This is a public forum and others can give you advice based on the results of the test. They speak for themselves, not for me. The test itself is harmless, but what're told you to do maybe not. For others who choose to run it, I do not recommend that you view the results of test on this Web site unless I ask.

    ______________________________________________________________

    Copyright © 2014, 2015 by Linc Davis. As the sole author of this work (including the "Test of diagnosis" referenced), I reserve all rights except as provided in the terms of use agreement for the site of Apple support communities ("CSA"). ASC readers can copy for their personal use. The whole nor any part can be redistributed.

  • All-in-one HP Officejet Pro L6580 is skip lines

    With the Test Page to the printer or document page, my all-in-one HP Officejet Pro L6580 is now skip lines.
    * original title - move printer head *.

    Hello

    ·                         try to uninstall and reinstall and use the latest printer drivers VISTA for your model of the manufacturer of the printer

    and look for a manual too

    You can also track information to try to solve your problems of printer below

    read the printer correct that information the slot microsoft, including the 'fix - it' and the information of the links to the other

    Solve printer problems

    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-printer-problems

    and read this microsoft tutorial too

    Introduction

    This tutorial is designed to help you identify and fix the problem printer common windows problems, including print errors, or errors, and other issues that could prevent you from printing. This tutorial does not cover printing problems related to specific programs. Printing problems can be caused by cables that are not properly connected, corrupt, drivers, incompatible drivers, the printer settings, missing updates and problems with your printer.

    How to use this tutorial

    For best results, complete each step before move you on to the next. Try to print after each step before moving on to the next step.

    http://Windows.Microsoft.com/en-us/Windows/help/printer-problems-in-Windows

  • This device is not present, is not working properly or is not all its drivers installed. (Code 24)

    Original title: Non-connectable & play drivers

    While looking through my device manager I found 4 of the Non-fiche & play drivers (hidden) with them in exclamation points:

    : Cherimoya

    : innfd_1_10_0_13

    : Iwnfd_1_10_0_13

    : MpKslefd0a58c

    I have no idea what these are, for only they do not work, the about property box: this device is not present, is not working properly or is not all its drivers installed. (Code 24)

    I checked with the driver for each page, and the following line appears for all: "the system has encountered the following error while trying to start the service.

    "The system cannot find the file specified."

    I leave principle that Win 7 needs them to work so any help there would be great, thanks in advance.

    Here's the likely remnants of malware infections that your anti-malware software has partially withdrawn.  See, for example:

    http://www.bleepingcomputer.com/startups/Cherimoya.sys-28755.html

    http://www.herdprotect.com/innfd_1_10_0_13.sys-3e2e078dc9ae42e6223468777ca67d6931a70904.aspx

    I suggest that you uninstall all of these elements, then

    1. Use the Virus Scan free online ESET--> http://www.eset.com/us/online-scanner/
    2. Download, install, update and run the free version of MalwareBytes AntiMalware--> https://www.malwarebytes.org/ you don't need for the Pro version, even if there is a free trial of this one.  During the installation of any software downloaded, be careful when installing and uncheck all the options selected by installing other applications.
  • "In App Purchase feature is not present in your binary."

    Our application was rejected twice now by iTunes.


    The first time we presented as an application multi-folio, with in-app purchases/non-consommables/0 layer $ price.  Told us that app in the purchase was not present in the binary file.


    " We found that, while you have submitted products In App Purchase for your application, the In App Purchase feature is not present in your binary.

    If you want to use to buy the App in your application, you will need to download a new binary that incorporates the in App purchase API to allow users to make a purchase

    Once you edit and resubmit your binary file, you also have to resubmit your in-App purchases for review, because they are in the State developer Action required. For each product in the IPA pointed out, please be sure to change the information in detail or to cancel the request to change the information in detail for App purchases using iTunes Connect. »

    We resubmitted as an application multi-folio with subscription iTunes, newsstand has enabled, with and without subscription in-app purchases / free. Yet once again, we have been rejected and said that app in the purchase was not present in the binary file.


    We try to understand what we're doing wrong and Apple was not much help.


    Bottom line, we want to offer our monthly magazine free of charge via the iOS app, just as we in the Google game store? Can anyone point us in the right direction?

    Don't implement everything in-app purchase in iTunes. Just post your public/free content in Folio Producer.

    Neil

  • APEX. ITEM.popupkey_from_query does not meet the relevant line

    I have a manual tabular presentation that contains a context field. When I click the pop-up icon, it displays the pop-up window. I select the line I want to fill in the field with, but he does not fill in the field correctly. He usually fills the 2nd, but not always.

    I have included the form in the sample Application as a page 22 of apex.oracle.com:

    Workspace: RGWORK
    Username: TESTER
    Password: test123
    Application: Example Application - 25152 (not Sample Application 20726)
    Page: 22: Advanced RG tabular forms

    Top 22 should be run directly.

    I appreciate your help.

    Robert
    http://apexjscss.blogspot.com

    Hello

    You must disable sorting of your form.

    BR, Jari

  • app purchase where the physical store is not present

    I am from Bangladesh and that you wish to purchase an app on the app store, but there is no shop in my country. is there an alternative way for app purchases where the physical store is not present

    TIA

    Mubaswir

    No, the only place to get iOS apps is on the app store (via iTunes on a computer or an App Store app on an iOS device) and you must be in a country to use its iTunes/App store (which is part of the terms of the store) - until if/when Apple open an iTunes store in Bangladesh (we are fellow users we do not know what might happen until Apple announce something) Unfortunately you will not be able to download any content from the iTunes store.

  • When I click on the right botton I see a small copy of the browser page. This problem on the new version of mozilla. This problem is not presented on 15 version of mozilla.

    When I click on the right botton I see a small copy of the browser page. This problem on the new version of mozilla. This problem is not presented on 15 version of mozilla.

    I think that you run two versions;

    The details of your system to watch;

    Shockwave Flash 14.0 r0 * Shockwave Flash 13.0 r0

  • a replacement lcd will set a screen with a gray screen or a screen that has lines

    a replacement lcd will set a screen with a gray screen or a screen that has lines

    To make sure that it is not software related, set it back to factory settings using iTunes on your computer.

    If the screen still has problems after that, have it repaired by Apple or an Apple authorized service provider.

    Use iTunes to restore your device to factory settings - Support Apple iOS

    Apple iPhone - contact Support - support

  • When I go to a secure site the usual security lock is not present at the bottom of the page

    I upgraded my browser Firefox 6.0.1 and now when I enter a secure site the security lock is no longer present at the bottom of the page.

    The status bar is gone and the 'blocking' with her, from Firefox 4.0. Safety information on a web page are shown by the Site identity button.

    The former lock could give users a false sense that a site is safe to not to provide information to the site and showed that there is a secure connection that does not guarantee that you are connected to the right server. The Site identity button is introduced in Firefox 3.0 to show more complete information of 'identity' for HTTPS web pages.

    https://support.Mozilla.com/en-us/KB/site+identity+button

    You can add a padlock in the address bar with the add-on locks- https://addons.mozilla.org/firefox/addon/padlock-icon

  • Satellite L500-13Z - HDD recovery is not present

    Sorry for my very bad English first!

    I want to reinstall Win7 but the recovery of HARD drive menu on the screen (Boot, F8, repair,...) is not present in the menu.

    If you n t understand my question, can u send me the web address of the French forum?

    Thank you

    Hello

    At first, I must say that your English is good and understandable.
    So, back to your problem.

    If it is not possible to repair my computer option is not available in the installation of HARD drive recovery advanced options of booting (from the recovery image stored on the HARD drive).
    It can only be done with recovery DVDs.

    You have created recovery DVD suite Toshiba tips and how to proceed?

  • Camera not present error &amp; Baumer GigE Test Packet (0xBFF69031)

    Hello

    I tried various fixes to other messages and still have problems setting up my TXG06 Baumer with LV running NOR-IMAQdx 4.0.

    The camera shows OK in the SDK of Baumer, but when you try to recover an image NI Max I get "the system has not received a test package...". "If I let MAX OR open and try the same device, sometimes I mistake"not present Camera. '... "instead, even if it is still running ok on the network.

    I added an exception to the windows firewall, enabled extended packages, tried to reduce the size of pcaket and tried without the Baumer software installed. Still no joy.

    Any help would be appreciated.

    Hi, noodles,

    It's quite strange, you seem to have tried all the troubleshooting steps that firstly, we recommend. How reduce you the size of packages to? Have you tried to set very low (~ 1 k) to see if even then you still cannot take a wink?

    What ethernet card are you using? (Just to be sure it's GigE) and have you tried this unit with another PC to see if the problem with your ethernet card?

    Thank you

Maybe you are looking for