Text flows create a delay when an overflow creates a new page, preventing you from reading the page number, giving error
Hi all!
I am creating a script to generate automatically a photo catalog; the idea is to prepare a master document with a text frame in the master spread with auto flowing, then insert images with their caption by the script, letting the system create automatically the subsequent pages when necessary by an unique flow of text.
My catalog is divided in sections, each represented by a different master spread; so I have to know in which page I am working when the script put there an image, just to link the current page to the proper master spread.
To simplify everything I have resumed the core of my script here, using text instead of images:
/* load a master document, only containing an empty text frame in the master spread, connected to the main text flow */
var doc = app.open(new File("~/Desktop/mySampleDoc.indd"));
/* I work on the story, thinking that whenever the textframe of the first page will be full, another text frame will be created in the next page (automatically created) */
var story = doc.pages[0].textFrames[0].parentStory;
/* now I put some lines of text into the story, expecting the creation of a new page when the first one will be full */
for (var i = 0; i < 100; i++) {
/* this is next line: */
story.insertionPoints[-1].contents = "this is line n. " + i + "\r";
/* here I want to know on which page is the line just created (error is generated here just during the creation of the new page + text frame) */
thisPage = story.insertionPoints[-1].parentTextFrames[0].parentPage.documentOffset;
/* and now I print page number */
story.insertionPoints.item(-1).contents = "current page: " + thisPage + "\r";
The big problem is: when the first text frame is full and an overflow is generated, a new page with a new text frame belonging to the main text flow (as the master spread wants) is generated; but it seems my script requests the page number before the new page with the new text frame is born, and an error is given.
It seems like the script goes too fast in respect to the creation of the new page.
If I delete the line thisPage = story.insertionPoints[-1].parentTextFrames[0].parentPage.documentOffset; everything is ok.
I tried to introduce a delay until 3 seconds without any effect.
I tried also to show or zoom the new page before the page number request, thinking to force the system to wait until page is really born, also without any effect (by the way, I was not able to show the page during the script's additions of text!).
Someone can help me?
Many thanks to everyone
Roberto
Many thanks: you are right!
Unfortunately, I am at the very beginning with ExtendScript, and there are so many things I don't know until now...
With recompose() everything works very well, and it give me a solution also for redrawing the page while the script is working...
Many thanks, again!
Roberto
Similar Messages
-
when I try to download a personal video to Facebook I get the message " Firefox prevented this page from automatically reloading". I click the allow button which lets it start downloading but it only stays on 3-5 seconds then gives me the message all over again. At this rate it would take an hour to download a one minute video. I also get this message in other programs and I don't have a clue how to stop it. Help me please!!!
Website servers can redirect more than once, so you may not see anything happen and may need to click Allow more than once.
See:
* Firefox/Tools > Options > Advanced > General : Accessibility : [ ] "Warn me when web sites try to redirect or reload the page"
The setting in "Tools > Options > Advanced > General" is meant as an accessibility feature, as you can see by the label of that section, so that people with disabilities or people who use screen readers do not get confused and is not meant as a safety protection to stop redirecting.
See also:
* http://kb.mozillazine.org/accessibility.blockautorefresh
* https://support.mozilla.com/kb/Options+window+-+Advanced+panel#General_tab -
Create a delay when a change occurs
Hallo ,
I would like to know how a delay can be created when i change the value of a pre defined control . The range control is a prefedined option that allows me to change the sensitivity . since it takes few seconds for the new sensitivity to be set i would like to create a delay when this value is changed . Kindly help me on this .
thanks and best regards,
Attachments:
delay.png 23 KBThanks a lot for your reply .I have implemented what you said. Unfortunately my hardware is facing some issues and i cannot test it right now.
Hope it works .
Thanks once again .
Best regards
Attachments:
delay2.png 22 KB -
Text is broken when scanning UP the page; but good scanning down the page; why?
Text is broken when scanning UP the page; but okay scanning down the page. The text looks like a shot gun has been fired through it. It used to be good both ways until the last update. This is not a problem in any other program including Internet Explorer. I have an image to show you but there is no link here to attach.
After clicking Allow I got ..........The add-on could not be downloaded because of a fault at the support site.Try to create a new Boolean pref on the about:config page via the right-click context menu with the name layout.paint_rects_separately and set the value to true and leave hardware acceleration enabled.
See comment 414 in bug 812695:
*https://bugzilla.mozilla.org/show_bug.cgi?id=812695#c414
If that didn't help then try to disable hardware acceleration in Firefox (you need to close and restart Firefox).
*Tools > Options > Advanced > General > Browsing: "Use hardware acceleration when available"
*https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes -
When i try to open itunes a hazard warning appears reading"the file itunes library.itl cannot be opened because it was created using a newer version of itunes" so i can't open my itunes on my computer
Try the following user tip:
Troubleshooting issues with iTunes for Windows updates
EDIT: My apologies ... it'd be better to start straight in with the following user tip:
Empty/corrupt iTunes library after upgrade/crash -
When I open iPhoto 9.2.1 it says that my library needs to be upgraded but when I upgrade the library I am trying to open (33 GB worth of pictures from 2006) the new application says it cannot read the files and how to find them on the system to reimport?! and then I'd like to erase the original files since the space requirement is huge!!!! Why is upgrading software iPhoto such a pain. I've gotta get a presentation done and all I get for my money is roadblock!!!
hello, it sounds like the library is damaged.
Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. -
when installing iTunes on my new laptop a message box appears saying some sort of error has occured and i have to uninstall it then reinstall it again and it still won't work what should i do?
Let's try a standalone Apple Application Support install. It still might not install, but fingers crossed any error messages will give us a better idea of the underlying cause of the issue.
Download and save a copy of the iTunesSetup.exe (or iTunes64setup.exe) installer file to your hard drive:
http://www.apple.com/itunes/download/
Download and install the free trial version of WinRAR:
http://www.rarlab.com/
Right-click the iTunesSetup.exe (or iTunes64Setup.exe), and select "Extract to iTunesSetup" (or "Extract to iTunes64Setup"). WinRAR will expand the contents of the file into a folder called "iTunesSetup" (or "iTunes64Setup").
Go into the folder and doubleclick the AppleApplicationSupport.msi to do a standalone AAS install.
Does it install properly for you? If so, does iTunes launch properly now?
If instead you get an error message during the install, let us know what it says. (Precise text, please.) -
I have just purchased an iMac 27" 2.7GHZ running OSX 10.7.4 with 4GB RAM (16 GB has been ordered). I am using Aperture 3.3.2. When I attempt to create a web page from photos the page goes white and nothing displays. Is this a RAM issue?
I have resolved the issue....turns out that, in my case, running OSX 10.8.1 with Aperture 3.3.2 was what was required! I was running Aperture 3.3.2 with OSX 10.7.x and had this issue.
I hope this helps someone else as well. -
When I open Safari 5.1.5, it automatically opens all the pages from my previous session. Can I turn off that feature , and how?
Hi...
Open System Preferences > General
Deselect: Restore windows when quitting and re-opening apps
Restart your Mac. -
I have a MacBook Pro and have problems using my Facetime. Last time I used it without problems. Now I am trying to use it, and it is asking that I enter my Apple ID. When doing so, it comes up with a message that says, "The server encountered an error processing registrion. Try again later." What does this mean, and how do I fix it? Thanks.
I had the same problem and found the solution here:
https://discussions.apple.com/thread/3189272 -
I have just transferred my entire application file from an Imac to an identical Imac, both running OS 10.9.5. Everything works fine, excepting that when I attempt to open Photoshop 6, I am prompted for the serial number. I enter the serial number provided by Adobe, which I have confirmed with my "previous purchase" records kept by Adobe. It is demanding a "qualifying product", all of which is contained in the complete files I transferred. Why can't Adobe recognise my valid serial number for Photoshop 6?
I have just transferred my entire application file from an Imac to an identical Imac,
Say what?
Please use the proper installer.
Are you really talking about Photoshop 6 or about Photoshop CS6? -
Hello -
I've been sent HD footage in MTS format and converted it to Mp4 for editing in FCE. It looks good in FCE but when I export the movie, the quality is noticably diminished. Is there any way I can prevent FCE from lowering the quality on export?
Thanks.>I use Foxreal video converter for Mac to convert the MTS using the Apple intermediate codec setting and the problem is that I don't get image, just audio
My thought would be to NOT use Foxreal video converter.
Use MPEG Streamclip or Clipwrap.
-DH -
When I try to reorder different pages it just takes all the pages within the document and turns them into a stack! Why is this happening and how can I oder pages as the update is meant to let me?
Any Help?I know the update has only been out a while but if anyone has an idea why it is doing this, please let me know!But you are telling me something I already know.
Be precise.
It is not Pages '09 that is broken.
I am back in Mavericks and testing Pages 5.2.
There are improvements, we shall see how useful, but in less than a minute I have already discovered bugs.
Peter -
When I try to log in to my account, I receive the message "a network error occurred while attempting to sign in". How do I correct this?
Hi Mark,
Are you trying to log in via Adobe Reader? If so, what happens when you log in via the web interface at https://cloud.acrobat.com?
(We've had reports of this error occurring in the latest version of Reader.)
Best,
Sara -
When I try to Bookmark a new page, I do not get the "Page Bookmarked or Edit This Bookmark" window. I t does place the site into my bookmarks but I have to go to "organize" bookmarks in order to put it where it belongs.
How are you saving a new bookmark?
There 5 ways to save a new Bookmark in Firefox, the first 4 should offer to save the new bookmark in a folder:
1.
2. Right-click and select Bookmark this Page.
3. Bookmarks > Bookmark this Page
4. Double-click the Star that is on the right side of the Location bar.
4a. (A single-click on the Star will save the new Bookmark to the Unsorted Bookmarks folder, without opening the Edit this Bookmark dialog.)
5. Drag the website image in the URL bar into the Sidebar view of Bookmarks
or to the Bookmarks menu bar item and then into the drop-down or onto the Bookmarks Toolbar
Maybe you are looking for
-
MainStage 1.0.2 released
MainStage 1.0.2 addresses specific customer issues and general performance issues and improves overall stability. This update is recommended for all MainStage users.
-
Aperture 3 - Continuous freezing and library updating
Aperture seems great when it works but is updating my library of 6000 pictures regularly for no apparent reason and this at a speed of one picture every two seconds. The computer is a 3.06 GHz Intel Core 2 Duo with 8 GB 1067 MHz DDR3 and should be ab
-
Apps crash on startup after 7.03 update.
I have tried resetting all settings, rebooted, and redownloading apps, but nothing seems to work.
-
In March we traded our flip phones in for smartphones. At that time they had a special going that we would receive $100 for each smartphone we purchased as well as the $35 activation fee waived for each phone. It is now August and we have not recei
-
My iBook is about 3 yrs old now, and it is my only computer, which i use on and off all day, writing, internet, etc. i was wondering which is better for the life of both the whole computer and the backlight/display when i'm not using it--putting the