Scripts and smartTextReflow

Hi, I've been in lots of posts on this forum and have not found an answer, even if a few people have had similar problems. I hope that some guru will have an answer.

1 ImportXML via script - OK

2. run some rules XML for example add page breaks - OK

3. have smartTextReflow via a text stream primary master page - NOT OK

As others have pointed out already, smartTextReflow is running asynchronously. I know this to be true since to get the number of pages after that step 2 returns the initial number of pages (2), not the final number of pages.

Have you tried:

app.waitForAllTasks)

document.recompose)

$.sleep(1000...)

All to nothing does not.

Y at - it no listener of events or way to trigger the code (to remove all empty pages etc.) after the reflow ended?

OK, I found a solution, but it would be much nicer if there is an event that could be handled asynchronously when finished and reinvest.

The alternative to an asynchronous callback is mark, so when I tried to use the ordinary JS but unsupported setTimeout() I fell to the equivalent of ExtendScript: IdleTasks for example:

//set up IdleTask
var myIdleTask = app.idleTasks.add({name:"myIdleTask", sleep:100}); //Run every 100ms - adjust as required
var onIdleEventListener = myIdleTask.addEventListener("onIdle", testPageCount); // That's emulated setTimeout...

xmlImport();     // Do XML Import
runXMLRules();     // Modify XML
...               // Other code...

var testCounter=0, initialLength=0;
function testPageCount() {
     if (testCounter==0) initialLength=document.pages.length;     //Get initial page count
     testCounter++;
     if (document.pages.length != initialLength) {
          $.writeln("["+(testCounter/10)+"s] FINISHED AUTOFLOW");
          myIdleTask.removeEventListener(IdleEvent.ON_IDLE, testPageCount);     // Remove IdleTask

          ...     // Whatever you want to do now document reflowed...

     }
}

Tags: InDesign

Similar Questions

  • I chose an add-on, "No Script", and I can't remove it.

    I chose an add-on, "No Script", and I can't remove it.

    So if you do
    Tools > Addons > Extensions
    and select NoScript (click it) and click on delete or uninstall (I forget who) what happens?

    It should disappear after reboot

  • Mini 210-1080NR: down loaded Windows 10. view now showing BACK script and will not change. Mini 210-1080NR

    Try load W-10. Process appear to be normal. The display is now BACK showing script and will not change and cannot close the laptop down or off. Not a user made and do not want to complicate the issue.

    WAWood;

    The laptop has completed W - 10 download and installation seems to work as announced.

    The problem with the 1st attempt will be captured in Gremlins.

    Thank you for your quick response.

    Ben

  • Scripts and css

    What is the best way to declare my scripts and css?

    Add a link to external JS files, as shown below.  Exactly where in the document depends on what it is used for.   In general, I keep my script libraries and function codes at the bottom of my document, just above the closing tag, while it loads after all the rest.

    CSS links go to the top of your document, on the inside of thetag.

    https://cdnjs.cloudflare.com/AJAX/libs/Twitter-bootstrap/3.3.5/CSS/bootstrap.min.CSS">

    Nancy O.

  • Why have I not only 2 fonts of type scrpit in LightRoom.  This happened after an update and now I only have Sergoe Script and another that I am now unable to find.

    After an update, I lost almost all my fonts I've used regularly in my copyright for the photos.  Now, I'm limited to Sergoe Script and Comic Sans Serif, or who are true fonts film scripts.  Why all these have been removed?  The program was purchased with the understanding that script fonts, I already had would be there and now I have nothing except a large number of fonts that look like Arial, Times New Roman or Comic Sans Serif, I need the rear original fonts.

    kathyh33445473 wrote:

    After an update, I lost almost all my fonts I've used regularly in my copyright for the photos.  Now, I'm limited to Sergoe Script and Comic Sans Serif, or who are true fonts film scripts.  Why all these have been removed?  The program was purchased with the understanding that script fonts, I already had would be there and now I have nothing except a large number of fonts that look like Arial, Times New Roman or Comic Sans Serif, I need the rear original fonts.

    Hello

    You need to verify that these fonts are installed in the first place and the reinstall, fonts are managed by the system. I don't think that Lightroom comes with all fonts.

    Which fonts are actually missing?

    There are a lot of free script fonts, which you can download from http://www.1001freefonts.com/script-fonts.php

  • I have a lot of unused space in my script and I need to add video tracks, but I can't compress it.

    I have a lot of unused space in my script and I need to add video tracks, but I can't compress it.

    hahahahahahahahaha!

  • InDesign server web service - where is the support to download a file with the script and download the result?

    Hello

    I'm working on a VINE which is supposed to convert indd files in pdf format (that is, using of course the indesign server). Basically, I want to call the Web Service of IDS (located on another machine, perhaps), spend in the input file, the conversion script and retrieve the result under the WebService call?

    Navigation on the documentation, examples, etc. in the SDK, I couldn't see how the above can be achieved unless the client manages the transfer of files. Surely I must be missing something...

    Thank you

    Chris

    What do you mean by POC?

    InDesign Server is too valuable (i.e. cost of the license) to waste his time with file transfers.

    For a smaller scale, letting a separate process (http or smb server) on the same server hardware files - InDesign Server providing access on the local volume faster.

    If you are planning for bigger, use a dedicated server for file sharing (at the choice of the SMB, NFS, or other), when the input files are prepared by the process of the client, so that your load balancing program can immediately point the next free instance of the InDesign Server farm to the file. In this case, be prepared for some trial and error - high-speed file sharing can be tricky with files written on one side not yet visible or incomplete on the other side, locking problems, filename Unicode trouble, unexpected time and so on.

    BTW, there is also a forum of InDesign Server which would be more suitable for these discussions.

    Dirk

  • jsx first Pro CC scripting and exportFinalCutProXML

    I use calls to exportFinalCutProXML in my HTML5 for first Pro CC extension, and while it works very well, if the project has effects that do not necessarily translate at the FCC, we are forced to see a modal dialogue on 'Report translation' instructions and an OK"" button.

    While I understand the advantage for direct interaction from the user, it would be nice to be able to disable this dialog box programmatically to appear during the use of jsx script and save this XML file to a file in a script or an extension (not to mention the dialogue boxes that tell the user when resave the project and the "generation FCP XML...") »)

    (kind of how we can define a level of interaction in the old days with AppleScript etc...)

    PS, no one knows if the jsx Premiere Pro support will get all the love in the near future updates. It is quite rare at the moment.

    Would like to have more direct access to update/add/remove tags without having to mess with XMP and hacks FCPXML import/export.

    Would also like to be able to reproduce by programming that the file-> export-> markers (in HTML).

    Be able to get object marker models and possibly request generation of thumbnails for a marker or a given setting programmatically.

    Thank you

    The f

    exportAsFinalCutProXML() now has an additional Boolean param, optional; If 'true' is adopted, agency will remove all warnings/messages.

  • Script to open INDD files, run script and closing

    Hello, I'm looking for a script that will open a folder of Indesign files, open each one, run a selected script, and then close each file.

    Right now I use Batch convert script to convert INDD INDD and run the script in the meantime (so I delete the extra INDD file). But I'm trying to eliminate the element of conversion, just the script of this part.

    Someone at - it any help? Thank you.

    HI erblo007,

    Use the code below can it be useful for you...

    var myFolder = Folder.selectDialog("Select Indesign Folder");
    var myIndsnFiles = myFolder.getFiles("*.indd");
    
    for(k=0; k
    

    If the above coding help for you, then please click on useful or correct answers for me.

    Thanks in advance

    Beginner

  • Help with tab script and auto custom calculation

    I have implemented a two-page order form in Acrobat, based on an InDesign exported to PDF and filled it with the fields for 30 items that can be ordered.  Each item can be ordered has a color, size, quantity, unit price and Total point (the last two are read only) field.  To the point Total, I used "value is the product of Quantity.x, Price.x of the unit") calculation and to calculate the subtotal, "value is the sum of the Total of the order of the day.

    My first problem is that the scope of subtotal does not reflect the exact amount I have label off a quantity field and enter additional data on the order form.  I would like for the date to be included in the subtotal as soon as it is seized.  I read a script custom hits (tab the cursor on the following fields after the form data of types of recipients in an area of the car) which could deal with this problem, but one) I can't find the script and b) which should be formatted custom for a field that must be the number in the format.

    My second problem is coming up with a custom to variable shipping rates, calculation script based on the subtotal:

    up to $25 - $6; 25.01 $ - $75 = $11,50; $75.01.00 - $125.00 = $15.00

    125,01 $ - $200.00 = $20.00; 200.01 $- $300 = $25.00; $300.01 - $400 = $30.00

    $401,01 - $600 = $50

    I would like to have two radio buttons, one for select Pickup (no charge) and the other to select priority mail delivery - the option button that selects priority mail shipping will show the amount of shipping in a separate, called text box shipping charges.

    I also need a calculation that adds 5% of the subtotal more ShippingFee, if people pay by credit card.  I was hoping that a calculation simple field would take care of it.  (Subtotal + ShippingFee) *. 05)

    For any help or suggestion would be appreciated.  If I need to download the form, I can do this, even if I need to know how to do this.

    See what Bill.

  • How to remove scripts and stylesheets from catalyst

    How can I stop BC to insert scripts and style sheets in my layouts? I worked on catalogue and the layouts of product page and models, but BC continues to insert scripts and style sheets that I don't want to understand, especially the borders and margins.

    I know not to remove all code leave blank of the /StyleSheets/ModuleStyleSheets.css

    But here's an example of an important product that includes a number of them including the effect of the layout

    "" < link href= "/StyleSheets/ModuleStyleSheets.css" type= "text/css" rel= "StyleSheet" / > "

    "< script type="text/javascript">var jslang ="EN"; '. < /script >

    "" < link rel= "stylesheet" href= "/CatalystStyles/Box.css" type= "text/css" media= "screen" / >

    "< script type="text/javascript" src="/CatalystScripts/Java_OnlineShopping.js">< /script > '"

    "< script type="text/javascript" src="/CatalystScripts/Java_Cookies.js">< /script > '"

    "< script type="text/javascript" src="/CatalystScripts/Java_Box.js">< /script > '"

    Any suggestions would be greatly appreciated

    I realize this is an old post but I stumbled across it trying to find the answer to this question.

    It is now possible! (Official notice of her here: BC.) Next - new Module/Tag, liquid & rendered Templating syntax Best Performance)

    It is possible only via the interface of the Admin of BC. Site manager > Page templates > More Options > check 'no HEAD element '. This command removes the default content generated by BC head, including ModuleStylesheets.css.

    Note: You have to manually re - insert BC scripts if they are necessary for the proper functioning of your page.

  • conditional post text export script and distilled

    Hello indesigners.

    I have a bit of a task needs to be done! I've never met and issue like this one, id as your help please.

    Asked me to make a brochure with 3 different languages, so I implemented the conditional text and composed of 3 conditions in the Panel of insularity

    each language has a spot color applied, in order to be separated during the validation script and distilled.but when the post script is distilled

    I can olny see a language.is there a way of all languages can appear on a separation of color with a language that overlap to another

    u2a.jpg

    u2a2.jpg

    Maybe I was not clear enough in my initial response. Make the layer method, you must turn OFF ALL BUT ONE SINGLE LANGUAGE (hide layers) and be sure to separate the plates language PDF files,

    OR, you must assign to EACH language for a recovery image for separations where languages higher in the stack have not eliminated the text on the lower layers (or knocked out of any background, they may overlap).

    I think it is easier to let all langiuages in [Black], which should by default overlay and hide layers.

    No matter what method you choose, if all language layers are visible at the same time, it will be difficult to work, and a composite PDF file will be a mess.

  • What is the difference between the output of the Script and the result of the query?

    Hello gurus,

    In Oracle SQL Developer, during the execution of a select statement running with the "F5 key", I get the output of the Script; And then if I execute the same select statement using 'Ctrl + Enter', I get basically the same data, but it is formatted to be a little different. and using 'Ctrl + Enter' I can adjust and reduce the size of the column (not the logical and physical structure) on the GUI screen to display all columns without having wide apart. What are the advantages/disadvantages to running queries using "F5" or "Ctrl + Enter"? If someone could shed some light on this topic bit, that would be nice.

    HI HAS LUNS,

    Text (f5) is functional, for the better or for the worst dumps select all.
    Chart is prettier - you get a complete data by select grid and scroll within the grid.
    There are a few other minor differences.

    Personally, I use mostly f5 /text/ (sqlplus emulation).

    -Turloch
    Team SQLDeveloper

  • Catch a failed to connect in a script and allowing a new attempt

    Hello
    When we release new code we provide a control to the DBA script that runs all the data/DDL change scripts for different schemas. The script invites you to connect as the users involved to run each script.

    for example, the control script is as
    WHENEVER SQLERROR EXIT ROLLBACK
    
    ACCEPT TNS_STRING PROMPT 'Enter Database Tns Alias:'
    
    PROMPT login as SCHEMA1
    ACCEPT PASSWD PROMPT 'Enter password for SCHEMA1 Account:' HIDE
    CONNECT SCHEMA1/&PASSWD@&&TNS_STRING
    
    @schema1_ddl.sql
    @new_schema1_package.pks
    @new_schema1_package.pkb
    
    PROMPT login as SCHEMA2
    ACCEPT PASSWD PROMPT 'Enter password for SCHEMA1 Account:' HIDE
    CONNECT SCHEMA1/&PASSWD@&&TNS_STRING
    
    @schema2_ddl.sql
    @schema2_data.sql
    
    -- etc
    Sometimes the DBA type a password - for example, schema2 - and we are left with only half of a release. 'Procédures' mean they can't or don't edit the control file to comment made sections so it's a pain in the ass for them to get back to us, we change the script, we review the revised script, we get approval on change, etc.

    We were wondering if there is a way to catch a connection failure in a SQL script and give them a try-I ruined my brain, but I can't think of anything. Anyone?

    It is a 9i database and they run the scripts in 9i SQL * more.

    You can tweak the autour logic and the first fetch and check the two apsswords. Then start running scripts.

    not tested

    WHENEVER SQLERROR EXIT ROLLBACK
    
    ACCEPT TNS_STRING PROMPT 'Enter Database Tns Alias:'
    
    /* testing connect to Schema1 */
    PROMPT login as SCHEMA1
    ACCEPT PASSWD PROMPT 'Enter password for SCHEMA1 Account:' HIDE
    CONNECT SCHEMA1/&PASSWD@&&TNS_STRING
    
    disconnect
    
    /* testing connect to Schema2 */
    PROMPT login as SCHEMA2
    ACCEPT PASSWD2 PROMPT 'Enter password for SCHEMA2 Account:' HIDE
    CONNECT SCHEMA2/&PASSWD2@&&TNS_STRING
    
    disconnect 
    
    /* work on Schema1 */
    CONNECT SCHEMA1/&PASSWD@&&TNS_STRING
    
    @schema1_ddl.sql
    @new_schema1_package.pks
    @new_schema1_package.pkb
    
    /* work on Schema2 */
    CONNECT SCHEMA2/&PASSWD2@&&TNS_STRING
    
    @schema2_ddl.sql
    @schema2_data.sql
    
    -- etc
    

    Published by: Sven w. on January 11, 2011 13:41 - change the formatting

  • Main difference between report scripts and calculation scripts?

    What is the difference between a calculation script and a script to report?
    THX in advance

    Kind regards
    SG

    It makes no sense comparing the report scripts and scripts of calculation.
    Report of the scripts are used to extract data for the needs of data flow down or needs statement.
    Calculation scripts are useful for managing business and process required for any application rules.

Maybe you are looking for

  • generator with the audio load options

    Hello IM new kind of movement, I am trying to add a drop down loading audio file (as seen here https://vimeo.com/115676446 at 0:21) a test generator, but I can't find a way to achieve the same result. I can publish anything, but options for audio. An

  • Pavilion g7-1076nr

    Hi, I'm new here and I have a question that hope you can help me. I want to improve my laptop CPU and I need to know if Intel® Core™ i5-480 M processor is compatible with my pavilion g7 1076nr. Thank you.

  • says printer can't communicate with the computer, but used to work

    also says: check the firewall settings to ensure dleacoms.exe is not blocked

  • When the windows 8 will be launched?

    I want information on when windows 8 OS will be launched.

  • my computer does not recognize my archos 5

    When I connect my archos Player 5 to my PC is not being recognized by my computer, the lead is not defective, as it is in charge when I connect it to the p.c., it started only recently, it connected every time so far, I think that it there is a probl