Remove / delete pages with javascript (or vbs)

There is a MyPage.Add ()... There is no MyPage.remove ()?

Can I delete a page with a script number?

The problem:

I have a problem facing pages. I need essentially to remove two pages to two pages, remove both and so on for about 2000 pages. Of course I could click and delete, but what would be the fun in that?

The pages are created in a facing-pages datamerge. I do not understand why CS4 cannot manage in the face of datamerge pages... Whatever it is, I need a work around.

Visually in the PAGES tab, what I have is the following

Merge data entry enter merge data

In the face of the Page A In the face of Page b.
Merge data entry AMerge data entry A
Merge data entry BMerge data entry B
Merge data entry CMerge data entry C
Merge data entry DMerge data entry D

What A, A, B, B, C, C, D, D, etc.

What I need to finish with is

A B
A
B
C
D

What A, B, C, D, etc.

The rules: the database is untouchable. Face to face Pages A and B side are formatted differently.

Any help or information leading to a job work around willl be rewarded of handsomly now that I get my cheque to a rich African uncle, I unfortunately discovered through an email today, had recently died.

Thank you very much!

Marc

But there is a myPage.remove)

There are frames of text on pages to delete block? In a script, it behaves exactly as in the UI: text block is moved to the next section in the thread (usually on the next page). So if this is the case, this script works but not the way you intended.

In any case, you want to delete a single page, then go two pages - remove two pages - jump 2 - etc., until the end of the document.

This Javascript should do it:

var curpage = 0;
app.activeDocument.pages[curpage].remove();
while (curpage < app.activeDocument.pages.length)
{
 curpage += 2;
 app.activeDocument.pages[curpage].remove();
 app.activeDocument.pages[curpage].remove();
}

It boings out with an error at the end if your document contains an odd number of pages (?), because he might try to remove a page after the last of them, but this isn't a critical error, it seems to me.

I tested it on a document of 30 +, and it has successfully removed #1, then #4 and #5, then #8 and #9, etc. Yet, paranoia is a healthy lifestyle (when applied to computers), then running on a copy, will ya.

Tags: InDesign

Similar Questions

  • Cannot delete pages with Acrobat Pro DC

    Hello

    I can't remove the pages of a PDF with Acrobat Pro DC

    I checked the properties and full control is thus authorized to change. I can actually change the text within the document, but I don't see how to remove some pages. The Edit function is accessible but not delete it.

    I'd be in a specific mode to delete the pages and if so, how access?

    Thank you

    Michael

    Process of

    1 tools > organize Pages

    2. select relevant thumbnails page (s) you want to delete

    3. click on the trash icon.

    4. in the 'Adobe Acrobat' dialog box message that says "are you sure you want to remove the page from the document?", click on the OK button.

    5. now, you can save the file or to continue working with the file.

  • Delete pages with empty text boxes that are threaded

    I tried the program and the forum and that you do not see the answer to what is probably a simple question.

    First the bottom -.

    I get files InDesign 100 + pages created with boxes of text block. I have change for a bigger and the text moves with the largest areas of text, everything as I want it.

    The problem now is, I have a lot of empty pages with empty text in them block boxes. When I try to delete the pages in the menu layout by selecting all empty it won't make more than one! (Because of the block of text boxes, I think.) There is often more than 100 when I'm through with my changes.

    Now the question-

    How can I easily get rid of the excess pages quickly?

    Thank you for your help

    Personally, I would not go the script. Course of thread should not affect the ability to remove any image and drilled it now which is threaded will cause just a nightmare on the road.

    That said, you should be able to open the pages Panel and select 'empty' pages at the same time by clicking on the first, then now Shift on the last. Then click on the trash bin icon. It is likely that you will get a warning indicating that the pages are not empty (they should have empty blocks of text on them). At this time it's OK to say go ahead and delete anyway. If you are worried, make a copy of the doc and do about it.

    If you are unable to get these pages to be deleted, it probably means that Smart Text Reflow is at work, so check if you have enabled delete empty pages in the preferences, or turn off completely. In the stop-coincidence one of these pages actually contained text put on to your pages, you will see an indicator of excess some hand (probably the last picture), then place the cursor at the end of their coaching to excess and press Ctrl (CMD on Mac) + Y to open the story editor and look to see what is actually in excess. If it is important, such as a table, for example, you need to understand why he was invisible (post another topic)., otherwise, select and then delete.

    If you are not able to delete several pages after messing around with the Smart Text Reflow settings, try replacing your preferences and check again the smart text reflow settings, and then try again.

  • How to remove master page with script elements

    I want to remove items from the master page with script

    app.activeDocument. masterPageItems.remove ();

    and there are items on the master page to remove all the and I want to create a new one (rectangle frame or text)

    Try this,

    var myDoc = app.activeDocument;  
    
    for(var i=0; i< myDoc.masterSpreads.length; i++)
    {
        for(var j=myDoc.masterSpreads[i].pageItems.length-1; j>=0 ; j--)
        {
            myDoc.masterSpreads[i].pageItems[j].remove()
        }
    }
    

    Vandy

  • Insert pages with Javascript

    Hello

    Is it possible to insert pages using Javascript? I would like to insert a page from a file on the click of a button. I used the following as a "Mouse Up" event on a button:

    this.insertPages ({nPage:this.numPages - 1, cPath:"InsertExampleSource.pdf"});})

    but it doesn't seem to work...

    Any help would be appricated.

    It may be, but not only with them. You will need to use a script of confidence in a file that is installed on the local computer to make it work.

  • Web page with javascript login indicates the connection in IE8 but not Firefox 9

    The web page http://epgservices.sky.com/nevermiss/ to load correctly in Internet Explorer 8 and displays the connection information, but these do not loading in Firefox version 9.0.1
    The connection is generated by Javascript that I see. Java is enabled and it is not blocked by AdBlock Plus because I have turned off to see if he made the difference, but the connection to this Web site is not displayed

    No problem here with Firefox 9.0.1 on Linux on this page.

    Clear the cache and cookies from sites that cause problems.

    "Clear the Cache":

    • Tools > Options > advanced > network > storage (Cache) offline: 'clear now '.

    'Delete Cookies' sites causing problems:

    • Tools > Options > privacy > Cookies: "show the Cookies".

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > appearance/themes).

  • Pop - up page with javascript

    Hi all

    Thanks in advance for the help.

    I have a page I get the use of a javascript url in a popup page. The popup works fine, but on the page popup, I have a process that I use to add a record, then I want the closed and the page refreshed that from.

    I put the following in the Add button url: javascript:window.opener.location.reload();window.close();

    but then the process does not although the page closes, and the first page is refreshed. The process in conditioned to the same key.

    What Miss me?

    Thank you

    Hello

    Put present it with the application you need (SAVE or SUBMIT or other) in your url:

    JavaScript:doSubmit('REUQUEST_YOU_NEED'); Window.opener.Location.Reload (); Window.Close ();

    Jos

  • Insert value in a column of the report in a page with JavaScript element?

    I have a regular report. He holds a single column, and each line is clickable (as if it is a link). When you click on a line, a modal pop-up window appears (created by the use of JavaScript).

    What I want is that when I click on a line, the value of the line I've selected is inserted in a page element. I want to use JavaScript so that I can do this dynamically, without refreshing the page.

    So if this column name is #TEMPLATEID #, then I want a page element (say P24_TEMPID) to get the value of the templateid some selected line.
    The function to open the modal is named OpenForm, I'd like to be able to write the code to insert the value in the page element that you want to be in this same function.

    How can I write this in JavaScript?

    Hello

    You cannot use surrogate column #MEALTYPEID # in the header of the page JavaScript. How APEX know value of line witch who is?
    Pass the two values of the column as a parameter
    JavaScript in the HTML page header

    function openForm(pTemplateId,pMealTypeId){
     $s('P24_TEMPLATEID', pTemplateId);
     $s('P24_MEALID', pMealTypeId);
     $('#ModalForm').dialog('open');
    } 
    

    Call JavaScript as

    javascript:openform('#FOODTEMPLATEID#','#MEALTYPEID#');
    

    Kind regards
    Jari

    -----
    My Blog: http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0
    Twitter: http://www.twitter.com/jariolai

  • Hide the controls of the Page on the Page with JavaScript loading

    Hello, I am using a piece of code that I found on another thread:

    ----------------------------------------------------------------------------
    Header HTML
    < script language = "JavaScript1.1" type = "text/javascript" >

    function setDisabled (PageItem) {}
    document.getElementById (PageItem).style.visibility = "hidden".
    }
    < /script >

    Attribute HTML Body
    onLoad = "javascript:setDisabled('P36_COMMS1_0');
    ----------------------------------------------------------------------------

    The code works if I change the 'onLoad' to 'onClick' and click the control. But when I use it as written, it does not fire when the page loads. Someone at - it ideas?

    Here is the original thread: http://forums.oracle.com/forums/thread.jspa?messageID=2760790 & #2760790, but the wire didn't really relate to my question.

    Donald

    Hello

    It does not depend on whether or not you set the option to activate the cursor to the first item in the page. This example uses the onload event of body as well and you can have as an event handler. To raise any doubt (especially since it is not always clear why a piece of code may fail, as you saw), I would recommend it by adding a room separate from javascript - you may, however, include the call immediately after the block so that the whole thing is within the tag of a script but make sure that the areas covered in the code are already rendered.

    Andy

  • Insert the value of a column in the report in a page with JavaScript element - 2?

    Hi guys,.

    As explained here:
    http://jholoman.WordPress.com/2012/02/26/Apex-4-1-page-items-to-submit/

    We have two reports, sources of the region including:

    Select * from dept
    and
    Select * from emp where deptno =: p1_deptno

    IN report of the departments link attributes, we use this script to set the value of the point P1_deptno
    onclick = "$s ('P1_DEPTNO', #DEPTNO #); return false; "
    In the report used region, on the article Page to submit, we put: P1_DEPTNO

    Then, we use a dynamic action to refresh the report used (she should get updated when the value of P1_deptno). where it is supposed to show the employees of a specific Department:

    But I have failed to do... You can pls, take a look:

    http://theexecutivetowers.info:8282 / apex
    workspace: opener
    user: fat
    PWD: fat

    Kind regards
    I use apex 4.1 on win 2008 Server. listener 1.1.3 deployed on glassfish 3.1

    I do not have your pencil link to work. This column did not assess the value of the #DEPARTMENT_NAME column.
    Who estimated that:
    OnClick = "$s ('P1_DEPARTMENT_ID', #DEPARTMENT_ID #); return false; »

    as opposed to
    OnClick = "$s ('P1_DEPARTMENT_ID', 10); return false; »

    I got your columns Dept ID name and dept to become links by their implementation. You can see what I did there. I defined a function in the page header.

    You also had a typing mistake in your SQL for employees (p1_dempartment_id) so I've corrected it to p1_department_id.

    All together.

  • How can I remove a page from a PDF document created through a scanner?

    My Scanner has created several blank pages in the PDF document.  It seems there is no editing tool to delete a page.

    The free Adobe Acrobat Reader software doesn't have this capability. You can either play with the settings of your scanner software and re-scan, or you can delete pages with the full version of Adobe Acrobat.

  • How can I delete a page with a specific attribute?

    Hello.

    I would like to know if it is possible to remove a group from a page in pdf format which contains a specific property.

    The main pdf document contains more than 100 pages. On some pages, there is a property text as 'DoNotPrint'.

    At first, I tried to convert it to XML format, this pdf file, to get a parent / child structure... and if I'm picking the attribute of a child node I could delete the parent node (and then the whole page).

    This pdf file is full of graphicals diagrams... so this solution will not work.

    That's why I try to work directly on the pdf file.

    Could you tell me if it is possible? I see that it is possible to remove a range of page, but I could do with my condition?

    Thank you very much!

    Yes. There is only a few elements added using the professional version with JavaScript. First is access by the JavaScript editor at the level of the JavaScript document and the PDF Optimizer that can perform batch processing, including the JavaScript on several PDF files.

  • Deleted pages move instead of being removed

    In my current document, I have gaps Preface and acknowledgements I would like to get rid of. I use a template from another site that is configured for a specific paper size, so because I did not implement the document myself I do not really great with InDesign. When I highlight the "spreads" as shown in the screenshot and click on remove spreads, it will remove the pages, but it takes the contents of their share and moves them down, by changing the "spreads" of viii-ix, x and xi to viii-1, 2 and 3. The first chapter begins on page 1, where it should be, and I would like to remove these 2 blocks spread and keep everything where it is. Any help is appreciated.

    AdzCYtq.png

    Thank you!

    It seems that the text in images on these pages is screwed into the same story as the body of your book. For someone with no experience of the ID, the easiest thing is to simply remove the text you don't want these images after you remove the "spreads" (removing the threaded frames does not delete the text inside them).

  • Replacing / liquid vs layout of removal of the deletion Page layout

    Not sure if I should ask this here or in the general forum of InDesign. But when it comes using the "alternate" layout What is the main difference between 'deleting pages' vs 'removing putting substituting? I tested both, and deleting pages seems the deletion of the provision of "spare" created.

    I'm just trying to decide if its worth using pages of alternative provision, even without the import option, or if I should just glue at several indesign files.

    If you remove only the pages on the alternative plan, you do not delete the styles associated with this provision. As a rule, delete (or cancel) alternate layouts; do not delete pages unless you want to keep for some reason autour styles any.

    Although the import of other layouts is not yet supported, I still think it's interesting to use the functionality in some cases. For example, if I need to create a vertical layout of horizontal or an iPhone to an iPad folio version, I sometimes copy the document, create another layout and then delete the original layout of the document copied so that there is only one provision. Can I use the import function to import the items.

  • How to remove (delete) the last blank page of the script?

    Is anyone of you know how to remove (delete) the last white page that appears in the script? My story is 126 pages long, but in the scenario (the document) 127 pages appear because the last is a blank page, how to erase this page? Thank you.

    You can try the following:

    -by pressing the delete key at the end of the text to page 126

    -Check if you have the ability to 'Unlock the Pages' in the Menu 'Production '.

    If you still face this problem, can you please save the document to disk (file > save to disk) and send us an email to DL-AdobeStory-supportadobecom, so that we can offer you a fix?

Maybe you are looking for

  • I don't have ancient history

    My ancient history disappear (I have only the history since like 2 months ago). How can I make firefox keep all history permanently?

  • After go away with the upgrade to version 7 Firefox once more crashing when trying to open PDF

    By clicking on a link which is a PDF file is almost certain to cause Firefox to crash.

  • install missing MSVCP100.dll

    I had to restore my system following an error caused by my internet provider.  How can I re - install file MSVCP100.dll is now missing on my Windows XP operating system?

  • PC health check

    My warranty has expired, but I would check how my PC is healthy, what I can and how, interested in how my PC is

  • Screen saver is blurred.

    I went to a web page called screensaver.com popular, I downloaded a few images of the screensaver for my screensaver. Now I have problems with my screen saver, it's blurred, I choose each screensaver is blurry, can you help me please? Sorry I meant d