Continuing from a script error.

This has been a very frustrating problem to solve. We create technical documentation for industrial equipment. With each machine, we ship a physical manual and a CD with an inveractive PDF.
For physical manual, we need to strip out the interactivity color formatting so the print version looks correct; i.e. the blacks are truly black and some black pixilated version of dark blue.
I was looking for a script that would search and replace character styles so that I didn't have to do in manually, document by document.
Vandy88 provided me with this nifty scrip which works like a charm:
myBookFile = File.openDialog("Choose the BOOK File", "INDB:*.indb", false);
var myDoc=[];
if(myBookFile != null){  
    app.open(File(myBookFile.fullName.toString()));
    var myBook = app.activeBook
    for(var n=0; n < myBook.bookContents.length; n++)
        myDoc[n] = app.open(File(myBook.bookContents[n].fullName.toString()));
        //--- cross referece style 1
        app.findGrepPreferences = app.changeGrepPreferences = null;
        app.findGrepPreferences.appliedCharacterStyle = "crossreference1";
        app.changeGrepPreferences.appliedCharacterStyle = "BoldUnderline";
        app.activeDocument.changeGrep();
        app.findGrepPreferences = app.changeGrepPreferences = null;
        //--- cross referece style 2
        app.findGrepPreferences = app.changeGrepPreferences = null;
        app.findGrepPreferences.appliedCharacterStyle = "crossreference2";
        app.changeGrepPreferences.appliedCharacterStyle = "BoldUnderline";
        app.activeDocument.changeGrep();
        app.findGrepPreferences = app.changeGrepPreferences = null;
else{
    alert("Please select the book file properly !!!");
Now, here's my problem: Our books contain not only the chapter files, but also the Cover; TOC, Parts Lists, Schematics, and Index. Not all of these documents have the same character styles in use, as some of them, such as the Cover, TOC, Parts List, and Schematics, do not have cross-references. As nice as this script is, as soon as it enounters a file that does not have the character style it is looking for, it stops.
What I need is a why to catch this error, tell it to ignore the document and move on to the next.
I have expermented with Try/Catch but with no success. Cannot figure out what code to put in Catch to make it keep going or re-cycle. Even tried: Catch (e) {n=n+1} to no avail.
Was wondering if there is some Catch code I haven't firgured out, or if I need to do some sort of an if/else statement that makes sure the first character style exists in the document, and then, if is not, tells the script to skip that document and move on the next. Otherwise, I'll have to create a custom book with only the documents I know have the styles. Not a difficult chore, but it would be best if I could have a block of code that would deal with the original book.
Much thanks to Vandy88 for the original code and I would be very greatful to anyone who can help me figure out this problem.

I need to process a total of seven crossreference styles but that is just a matter of coding so should be no big deal.
You can put a list of styles (find-change pairs) into array (to be more exact array of arrays) and then loop through its elements like so:
var i, myFindStyle, myChangeStyle,
arr = [    ["crossreference1", "BoldUnderline1"],
            ["crossreference2", "BoldUnderline2"],
            ["crossreference3", "BoldUnderline3"],
            ["crossreference4", "BoldUnderline4"],
            ["crossreference5", "BoldUnderline5"],
            ["crossreference6", "BoldUnderline6"],
            ["crossreference7", "BoldUnderline7"]
for (i = 0; i < arr.length; i++) {       
    myFindStyle = myDoc.characterStyles.item(arr[i][0]);
    myChangeStyle = myDoc.characterStyles.item(arr[i][1]);
    if (myFindStyle.isValid && myChangeStyle.isValid) {
        app.findGrepPreferences.appliedCharacterStyle = myFindStyle;
        app.changeGrepPreferences.appliedCharacterStyle = myChangeStyle;
        app.activeDocument.changeGrep();
You  can also put this list into a separate txt-file and read it by script splitting it into array.

Similar Messages

  • Import bookmarks from json - scripts error

    New profile. Import bookmarks from json - scripts error. Why?
    From HTML - icons YES, import NO errors, tags NO(
    From JSON - icons NO(, import with errors, tags YES
    May be fix\repair\check places.sqlite, how?
    [img]http://i.imgur.com/jCrGYKp.jpg[/img]
    [img]http://i.imgur.com/5f8opcf.jpg[/img]
    [img]http://i.imgur.com/vnIpPZw.jpg[/img]

    Restoring a JSON backup with 12000 bookmarks can be quite a challenge.
    Maybe try this is a second profile and disable the timeout to see if it finishes.
    *http://kb.mozillazine.org/dom.max_chrome_script_run_time
    If it works then you can copy the places.sqlite file to the current profile folder.
    *http://kb.mozillazine.org/Profile_Manager
    *https://support.mozilla.org/kb/Managing+profiles

  • Open email & top of bar says fire fox not responding & get script error on page asking to stop script or continue. Loading most mail or sites is slow now that I returned from Japan and using same laptop. Any ideas?

    my laptop stops responding when I open email right in the middle of writing email or checking email and when I open bookmarks. Up the top it says firefox not responding and a script error block opens asking me to continue or stop script. It give me this same error all the time no matter if I select continue or stop script.

    As far as email sites go. The "Adblock Plus" extension with at least the "EasyList US" filter subscription would probably help. I does block a lot of unnecessary Script files whose sole purpose is to provide advertising. You can of course add additional filter subscriptions or filters of your own.
    There are many extensions that can cause such problems, and you may have to go through your extensions.
    One thing you might do is eliminate Problematic Extensions that you are not using, but mainly check to see how the create problems and you may have to make a choice between extensions. The Unresponsive Script Warning page lists some extensions with problems (thought it listed more) and describes how to check through your extensions to help find which extension is the problem Sometimes the message will tell you.
    * '''Problematic extensions''' - MozillaZine Knowledge Base<br>http://kb.mozillazine.org/Problematic_extensions
    * '''Unresponsive Script Warning''' - MozillaZine Knowledge Base<br>http://kb.mozillazine.org/Unresponsive_Script_Warning
    * Firefox hangs - MozillaZine Knowledge Base<br>http://kb.mozillazine.org/Firefox_hangs
    Here are some extensions I had a problem with, and don't use them any more
    : http://dmcritchie.mvps.org/firefox/infolister_listing_fx4.htm#scriptbusy
    * Line Marker, Firefox 1.0 - 1.5.0.* ALL (2.0.2006072201)
    * Quick Sum (0.1), presumably good for Firefox 2.0
    * Translate (0.6.0.9), Firefox 0.9 - 1.5.0.* ALL
    * gTranslate (0.3.1) [30KB], Firefox 1.0 - 2.0.0.* ALL
    <br><small>Please mark "Solved" one answer that will best help others with a similar problem -- hope this was it, but take your time and try to make sure you pick the answer that helped you, and tell us which extension or script you found to be the problem.</small>

  • Unable to print pages directly from internet explorer 9 script error 2126

    HP photosmart wireless b109n-z
    computer Packard Bell One Two L5861 64bit
    I am unable after going to many forums where it seems to be quite a problem and trying different ways to try and rectify a error mesage
    An error has occurred in the script on this page
    Char 1
    Error Unspecified erroCode 0
    URL: res://ieframe.dll/preview.js
    do you wish to continue running scripts on this page?
    yes  no
    I also have avio laptop which i have no problem with printing on the same printer
    I have checked internet option advance settings and both have the same boxes ticked
    i have ticked and unticked boxes reset internet unstalled and reinstalled printer
    I can save most pages to documents and then print from there this depends on whats in the page
    The only thing that seem to make any difference was to untick the internet option security enable protection mode which would ineffect leave my computer vulnerable to attacks which is not advisible
    would be very pleased to hear if this can be resolved
    many thanks

    tejo11,
    Script errors like this can happen with IE and while uncommon are not unheard of. With the print and scan doctor coming back fine we can move to troubleshooting the browser where the error originates. If you would like try using a different browser as a temporary workaround and use this microsoft guide for troubleshooting the script error you are getting: http://goo.gl/k7aTU
    Best of Luck!
    You can say thanks by clicking the Kudos Star in my post. If my post resolves your problem, please mark it as Accepted Solution so others can benefit too.

  • HP Laserjet 1018-script error message when I print from web sites

    I have a HP Laserjet 1018. When I print from Microsoft products, it prints fine. However, when I try to print from a web site, it gives me an error message stating that there  is a script error.

    Its some PDF files, it prints using Adobe on a Windows OS just fine, but not in adobe on the Mac. It prints using preview but all the fine details of the picture does not print. One file that does not print is a drawing generated from AutoCAD.

  • On starting up firefox i am getting an error message from javascript application telling me that my username is an invalid username/password combination.If i continue to get this error message,try entering my email address as my username.

    Hi,on starting firefox which i have used solely as my browser for years i am now getting an error message from java script application that shows my username followed by a message saying; 'username'-Invalid username/password combination.If you keep getting this error,try entering your email address as your username'. I then press the OK button within that error message box and it dissapears and everything seems ok although hover my cursor over the mail(envelope) icon and it says not connected.
    I only started having this problem since downloading firefox 4.It also does not tell me where this problem is occuring so i do not know where to log on with this information.I would be most grateful for any help with this matter.Many thanks.

    Take a look in the Error Console for details about that.
    Tools > Error Console <br />
    Right-click the message and use '''Copy''' to get that complete message.

  • Why do I get a "script error" message from Adobe flash player?  It is installed as a part of my browser.IE 11

    Why do I get a "script error"  from flash player when it is not installed separately?  It is part of my browser--IE 11

    Same error message, I disabled tab mix and made sure I only have the newest version of Java, restarted firefox, now it seems to be fine no error yet on Pogo games or pictures upload to ebay which were the biggest problems besides hanging. I had also had disabled AVG secure search yesterday but that did not solve the issue. Now I will try to add back in AVG search...I have very few adds ons, also the note embedded about re- installing a toolbar went away, my old one did not work with FF4, so I installed Yahoo toolbar but the message still did not go away until I applied this fix. Hopes this helps someone..

  • Script Errors in TOC from RoboHelp 9

    Hello, all. I can usually find the answer to my problems by searching existing threads, but I can't seem to find a solution this time. I recently upgraded from RoboHelp 7 to 9.0.2.271. I have published WebHelp locally and then checked files in to a Team Foundation Server to be deployed to a testing environment. Locally and on the QA site, the output looks fine for me and the TOC works as expected. However, other users on Internet Explorer 7 and 8 (I have IE8) get script errors when trying to click on pages in the TOC.
    I zipped my local files and dropped them on a shared drive and asked one of the users to copy them to his machine and open the start page with his browser. He still gets the script errors, whereas another user can open them locally with no problems. This makes me think the problem is not in the RoboHelp files themselves, but I am not sure.
    To further complicate matters, in the staging environment, a different server from QA, the TOC and Index are empty! This is obviously a separate issue, but I am stumped. This issue occurs in IE 6, 7 and 8. It does NOT occur in IE 9 or Firefox.
    Any ideas?

    This issue was fixed with a reply from another discussion:
    Re: RH8 > WebHelp > TOC won't render in IE8 via HTTPS - Fix/workaround?
    If TOC/Index/Search is not working in IE7/8/9 via HTTPS, Please try the following steps
    Go to https://acrobat.com/#d=WqbdTq-2R79ToU08-zfBEw
    Download IESearchIssue.zip file. Unzip it.
    It will create a folder IESearchIssue. It has two subfolders
    RH8.0.2
    RH9.0
    If you are using RoboHelp 8.0.2, go to RH8.0.2 folder.
    if you are using RoboHelp 9.0, go to RH9.0 folder
    Go to <RoboHelp Install Folder>\RoboHTML\WebHelp5Ext\template_stock folder and rename the file whutils.js  to whutils.js.bak
    Now paste the already copied new whutils.js in same folder.
    Now again generate webhelp output of the required project.
    Host it to your webserver and check if it works.

  • Script Error, Continue?"

    When I launch Media Center Deluxe II I have this error:
    Script Error, Continue?
    I download the patch but the error persist. I have a windows 2000 with a FX5200 Thx a lot.

    There is one solution, you can always upgrade to XP.
    I know the prospect of upgrading to XP is not a pleasant one, I am in the same boat.  But I don't see that I have much choice.
    All I can say is, this is the LAST time I buy ANY MSI card board or other.  
    I ran into a similar problems with ASUS years ago and haven't bought an Asus product since.  I had bought the latest Asus motherboard and the latest Asus Deluxe video card and found out they were incompatible with eachother.  I never bought Asus since.
    Apparently the problem with my MSI Motherboard and MSI Video Card is similar.   Except this time MSI says it works with Win 2000 Pro.  I buy it and find the same script error as you.  My supplier won't give me a refund an I can't afford to waste money on another Video Card.  I contacted Tech support and they told me that they never heard of such a problem.   They further told me it should work and they have no idea how to fix it.   They suggested I try reinstalling my OS.
    As far as I am concerned, the problem is with thier installer.   It appears to be looking for some video or multimedia function that is only available in XP.
    If MSI wants to regain my trust, they better provide me with a simple interface to get this remote working or provide me with a FREE replacement product that supports all the features of my card.  Otherwise they will lose my business for good.   I don't like companies who lie to sell products.  
    I am a supplier of MSI and other products and sell about 500 MSI products a month in each of my locations.  It would be a real shame if I dumped MSI components altogether.
     :O

  • Unresponsive script error from "chrome://browser/content/browser.js:5582"

    I always get a unresponsive script error from chrome://browser/content/browser.js:5582 . If I uninstall and reinstall firefox, It'll stop for awhile. My os is ubuntu 10.04 64 bit.
    == User Agent ==
    Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.38 Safari/533.4

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]

  • RoboHelp 11 - When previewing topics from within the project, a script error displays: 'HHComponent Activator' is undefined. How do you get rid of this script error?

    RoboHelp 11
    When previewing topics from within the project, a script error diplays: 'HHComponent Activator' is undefined.
    How do you get rid of this script error?

    Hi there
    Have you tried clicking Help > Updates and applying the service release?
    If not, I'd start with that.
    Cheers... Rick

  • New Tab script error prevents other functions from working. How do I remove "New Tab" content (sponsored links, etc)?

    I actually found the settings for it in the top right corner of the page, but figured I'd report it anyway.
    Basically, the New Tab Tiles have been causing script errors (prompt to stop script) that disable a few navigation controls, like being able to close a tab. Any tab that is open or opened after the script error will not close. I have to restart Firefox for the controls to start working again. I have found that the tiles that have been causing the problems are the one's that Firefox provides, as it still happens when my internet history is clear and not loading any tiles from my history.
    It doesn't happen every time, but it does happen regularly. I just changed my settings from "enhanced" to "classic" and will see if this helps, otherwise I will just turn it to blank if its still an issue.

    If it does happen there are other add ons that block scripts like No Script.
    However for script errors, general troubleshooting can be found: [[Warning Unresponsive script - What it means and how to fix it]]

  • When I open Add-ons, from the Tools menu, I get an unresponsive script error: file:///C:/Program%20Files/Mozilla%20Firefox/components/nsExtensionManager.js:623.

    When I try to click on Add-ons, from the Tools menu, I get this error message of an unresponsive script: file:///C:/Program%20Files/Mozilla%20Firefox/components/nsExtensionManager.js:623. This is to say the least about the unresponsive script errors at other times. However, at all times, it won't go away - even by clicking on the 'stop script' option; even with checking the 'don't ask again' option. I've cleared the cookies and history as best I could, but it appears that there is some sort of conflict. How can I resolve this? Kevin: [email protected] Thank you.

    This is typically caused by a problem with the Personas Plus 1.6 add-on and it conflicting with the Google toolbar.
    Try disabling the Personas Plus add-on. To do this open the add-ons manager by selecting the Tools menu, then Add-ons. In the list of installed extensions click on Personas Plus, then click on either disable or uninstall.
    If you can not access the add-ons manager, follow the instructions in the [[safe mode]] article to start Firefox in safe mode. You should then be able to disable or uninstall Personas Plus. You can find more information on this procedure in the [[Troubleshooting extensions and themes]] article.

  • I keep getting script errors when accessing Amazon Seller merchant pages. I get the following A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete. Script

    I keep getting script errors when accessing Amazon Seller merchant pages. I get the following A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete. Script: chrome://spautofill/content/spOverlay.js:150, I also get js210 as well. I have cleared all cookies and history and unistalled Firefaox and reinstalled. Been thru my AVS and set the site as trusted in every possible place. Still get the problem. Do not get it with IE on same PC.
    == URL of affected sites ==
    https://sellercentral.amazon.co.uk

    Same problem but with a different vendor site:
    https://www.webvitamins.com/myfavorites.aspx
    Not only does the page hang, but the other tabs also hang.
    I contacted the vendor and their reply was "we were told that this looks like a script that is used by "Sticky Password", third-party software that must have been installed on your browser. However, our website did not install it and does not have anything to do with it." As far as I can tell, "Sticky Password" is not installed on my Firefox.
    Same problem as above occurs, but with IE 8.0.6001.18702. Therefore, it is not unique to Firefox.
    CAUSE DETERMINED: Have determined that this problem only occurs when Kaspersky Password Manager is installed. In Firefox, if the "Password Manager Autofill Engine" add-on is disabled, the problem goes away.

  • Why do I continue to receive an error msg when converting files from pdf to Word?

    Why do I continue to receive an error msg when converting pdf files to Word?

    HI tatamene,
    I'm sorry that you're having trouble converting a document.  For starters, have you verified that your account is active? (You can check by logging in to www.adobe.com and checking under My Subscriptions and Services). Aside from that, I'll need a little more info to get to the bottom of your problem.
    Are you trying to convert the file from within Reader, or directly via the ExportPDF website?
    What operating system and browser are you using?
    How large is the file that you're trying to convert? (There's a file-size limit of 100 MB.)
    Is the computer that you're using networked?
    Do other files convert without error?
    I look forward to hearing back from you.
    Best,
    Sara

Maybe you are looking for

  • Sshd is running but doesn't seem to accept connections

    Hey guys I'm setting up a new machine which serves as a gateway for my private network.  I have iptables set up and ip forwarding is working correctly.  I can't seem to connect to this machine via ssh.  This might be something I did incorrectly with

  • Align components in HtmlPanelGrid or HtmlPanelGroup

    Hi, I am just sturted in JSF. I need to create a static table with 2 columns. Second column contains image. I use htmlpanelgrid to create the table. How can I align image in second column to the right? Thanks for any help.

  • Stage.quality property on FLEX and AIR

    There are 2 source codes to resize bitmap data, one for AIR, one for FLEX. The codes are same without .mxml head statement that is <mx:WindowedApplication> or <mx:Application>. The code are: 1. create TextField object and set "XYZ" into it with font-

  • How to make system backups

    I've had an S10-3 for a couple of weeks.  I just realized that there weren't any DVDs shipped with the system, so I wanted to create backups of the partition.  Any suggestions on how to do this?  I know there is the OneKey Recovery software included

  • List of all objects authorized for standard abap role

    Hi all, Can any body help me to get " List of all objects authorized for standard abap role " And List of all objects authorized for "admin role". Thanks Basu