Using app.findGrep() and app.changeGrep() consecutively

I have a script that should find and replace predefined terms and mark the changes visually on a separate layer. 
The process basically works in two steps: 
Loop through a list of expressions, look for every expression with app.findGrep() and insert Note-Markers at the beginning and at the end of a match. 
Loop through the same list again and find & replace with corresponding terms of another predefined list, using app.changeGrep(). After that, use the positions of the markers to draw rectangles on a new layer in order to visualize the changes. 
The problem is that even though Step 1 works fine (marks show up at their correct positions), step 2 doesn't seem to do anything, unless I change the findWhat parameter to an expression that hasn't been used already in the list of step 1. 
So, my guess is that Indesign somehow caches all performed searches and prevents any further look-ups with those expressions. 
However, if I use the standard find&replace form after the execution of the script, I can still find any expression from the list without any issues. Can anyone see how I can solve this issue? 
Thanks for any help!
Sam

I don't know what is your 'predefined list'.
Look at the following code snippet, the hope can help you:
var mDoc = app.activeDocument, mFind,mChange=0;//step1app.findGrepPreferences = app.changeGrepPreferences = null;app.findGrepPreferences.findWhat = '\\d+kg';mFind=mDoc.findGrep();//step2for(var i=0;i<mFind.length;i++) {    app.findGrepPreferences = app.changeGrepPreferences = null;    app.findGrepPreferences.findWhat = '\\d+';    app.changeGrepPreferences.changeTo = '$0';    var re=mFind[i].changeGrep();    mChange+=re.length;}app.findGrepPreferences = app.changeGrepPreferences = null;alert("find:"+mFind.length+",change:"+mChange);

Similar Messages

  • I'm having trouble using the iTunes and Apps store because i can't register my Nigerian mastercard. What should i do. i'm trying to register it in the Nigerian iTunes store.

    I'm having trouble using the iTunes and Apps store because i can't register my Nigerian mastercard. What should i do. i'm trying to register it in the Nigerian iTunes store.

    Is this a new Apple iD? If it is, and you have already set it up, then you have two options:
    1.     Temporarily put a Credit Card or Gift Card on the account to download the free app. If you put a credit card, then once you have downloaded the app, you should be able to go into your Account preferences and change the payment option to = None.
    2.     You can download the fee App, and then set up a new Apple ID.
    Cheers,
    GB

  • Can wife's iPad use my music and apps if authorized?

    We have a new iPad for my wife but set up under my name to get all our apps and music already purchased under my name.  Can I authorize her iPad so she can use my music and apps but set it up under her name on iPad?  Since it is currently under my name we can't use FaceTime. I think the iPad FaceTime thinks I am trying to call myself when I try to FaceTime my iPhone.  Please advise. Thank you

    Tbox17 wrote:
    So, I should keep the ipad signed in as me and then just change Facetime to have her email.
    Yes. You can add another email address as her "contact at" email address (Apple will verify the email address) and then you can uncheck (remove the checkmark) next to your Apple ID email address on her iPad and she can begin using the new email address for FaceTime.
    I have 4 devices setup using my Apple ID for shared purchases (including my Mac) and I can FaceTime with all 4 of them - from all 4 of them.

  • All of my purchased apps (games) and apps such as Weight Watchers, Facebook, WeatherBug, Sports and Pinterest, Notes, Nook, etc.  are all locked up.  They simply flash, then nothing!  How can I fix this to make them work again.

    First Issue:   All of my purchased apps (games) and apps such as Weight Watchers, Facebook, WeatherBug, Sports and Pinterest, Notes, Nook, etc.  are all locked up.  They simply flash, then nothing!  How can I fix this to make them work again?  If I have to delete the purchased apps, will they still be in iTunes, or will I have to re-purchase them? 
    Second Issue:   When I synced to my desktop (Windows XP)  All my photos loaded onto my iPad2.  I don't really want all 3000 + pics on my ipad!!  How do I get them off?  Next time I synced, they loaded again!  Now I have so many duplicates!  How do I get rid of the photos and prevent this from happening again?

    If none of your third-party apps are working, but the Apple built-in ones are ok, then try downloading any free app from the store (as that appears to reset something) and then re-try them - the free app can then be deleted. In terms of re-downloading apps then you can do so as long as they are still available in the store, and you use the same iTunes account as you originally used to buy them, then you should be able to re-download them for free : http://support.apple.com/kb/HT2519
    For synced photos, then with the iPad connected to and selected on the left-hand side of your computer's iTunes, then on the Photos tab on the right-hand side you can control which photos are synced to the iPad : http://support.apple.com/kb/HT4236 . If you don't want any photos to be synced then try selecting just an empty folder.

  • HT2534 How do I use my Itunes and App store account without credit card info

    I've already made an account and when I try to download an App from the store it says I need to put in credit card information.

    How to Get Apps From the App Store Without a Credit Card
    http://ipadhelp.com/ipad-help/how-to-get-free-apps-from-the-app-store-without-a- credit-card/
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
    http://support.apple.com/kb/ht2534
    If None is not available - On your computer launch iTunes and click "iTunes Store" in the left navigation pane. Click the "down arrow" next to your name at the top right side of the page and click "Account." Enter your username and password and click "View Account" to log into your account information. Next to your Payment Type, click "Edit." Select the "None" button and click "Done." Confirm that your card has been removed by returning to the Apple account information screen. Under Payment Type, it should say that there is no credit card on file.
     Cheers, Tom

  • App store and apps problem when migrated

    I am going to ask this here because Apple support has not been able to fix this.
    Old computer = iMac core 2 duo 2.4GHz 10.6.7
    OK so I just bought a new iMac quad core i7 2.93GHz (2010 model on closeout) and from the start I selected to migrate from a time machine backup. Took a long time but worked (well execpt for this problem).
    So one thing I noticed after the backup was that there was no app store program installed. I then noticed the OS that was on the machine was 10.6.4 (pre app store). So I did the upgrade and and it's now at 10.6.8.
    Problem is the apps won't load (click and nothing happens, click on ones in dock and it bounces once then nothing). So I load up the app store and log in, seems to take my login OK but won't let me do anything like make a purchase or do an update to an older app. It tells me they were purchased with a different account when I try to update and tells me I don't have a valid account when I try to purchase.
    Well it's a good account and I went back to the old computer signed out and back in with the 'exact' same info and it works fine on that computer, even did the update to the program that was older"
    Called Apple support, ran me through a dozen things (I could tell he was running out of ideas) and he finally said it must be a problem with your account (I seriously doubt it as I use the same account on the old computer, a laptop and 2 'i' devices with no issue).
    I think it has something to do with the fact that the migration happened when the OS was older than the app store.
    Not sure what to do but I would like to be able to use the apps I purchased and be able to purchase more in the future.
    Any ideas?

    Well looks like the fix was to download the stand alone 10.6.8 updater and re update the OS.

  • Unifying web apps, modules and apps for better discoverability

    Hi guys,
    With the rise of open platform apps, and the growth of the developer ecosystem, we are facing a few challenges impacting user experience and apps visibility. The main ones that we see are:
    Increase the app market place visibility inside the BC admin console
    Reduce the confusion among beginners and SBOs generated by the two very similar concepts (web apps & modules) to which add a third one (open admin apps)
    Reduce the barriers in front of partners looking for additional functionally so that we increase apps sales to the app developer’s benefit
    One way we’re looking to solve this is to unify the Module & Web Apps entries into a single one called Apps, to which we’ll also add the open admin apps. From this Apps top level entry, partners will be able to see the list of apps (on the long run, the current BC modules will also become apps), add a web app  and browse the app market to purchase and install custom apps.
    The main benefit of this approach will be a really fast and easy discovery of apps and the app market, which will make it easier for new partners to understand the concepts and also drive more apps sales. The downsides (cause this is not a perfect solution) are that those of you who have built training videos need to reshoot some of the, to take this menu change into consideration and the mix of the custom app with web apps.
    What do think about that, or what would you suggest us to do to provide better apps visibility and discoverability.
    Regards,
    Cristinel

    Hi Christenel,
    I understand what you are trying to do and I think it's a good initiative, but I partiall agree with Liam. The Modules and Webapps should remain where they are.
    1. Modules are each an indiviual type of functionality that work in a very specific way. They cannot be changed and are core features of the BC system to meet a very confined function.
    2. Webapps are a piece of functionality that also work in a very specific way however, they can be modified to meet a specific need within a set of confined boundries. Simlar to modules they cannot be modified outside their acutal scope. The UX is generic and cannot be customised hence it sits in the middle of a Module and an App but they can be built of the fly. From an non-developer partner, this is a very important difference.
    3. Apps ( or what ever they are called) site outside the the scope or boundries of Modules and Webapps and can be complety tailored to meet a specific need as well as being an extension BC capabilities. They don't necessary have to rely on BC functionality.
    I can create an App that is in-fact a Webapp, or an App that is a completely independant of BC functionality, or re-write an entire module or existing piece of functionality (like an ecommerce app or a News Module).
    With the App Marketplace you are not only going to have a variety of products meeting different business needs, but also work and be styled completly different to each other as no UX can be the same without some sort of overlying UI framework. This will become very confusing when the experience in BC become's a hap-hazard collection of different UI's and UX's.
    I have to think more about this by my proposal would be to keep things the way they are but have an App Market Place where you can browse download Apps and install them to the specific area like a module, webapp, ecommerce, CRM etc. BUT the UI needs to be consistent.
    The core modules of BC is what's used in any CMS. What I would love to see is BC release the Events Module for example, which I can download, customised to suit my needs and replace the current module with the additional features that I want or have been asking for over the past several years. Like adding an event end date with my own custom tag that I can add it for the additional fields. While still keeping the core functionality like list views, and tags.
    My last point is that my understanding is that BC was not going to get involved with an App Marketplace? Has this position changed? and how does this affect Brent's works?

  • Argh! iPhone 2.0 App Store and Apps are $%#'ed

    So I was at one point, able to log into the App Store, and "purchase" free apps... now I cannot hit the "OK" button when it prompts me for my password... or cancel for that matter, have to hit the home button, goto iTunes, get the App, then sync it back.
    That worked until 2 days ago, now I cannot even run ANY apps! I have unsync'ed them (effectively deleting them), re-sync'ed them (re-installing) and every app will show me the title screen for about .5 seconds, then back to the home screen... Aren't I glad I got the 2.0...
    Anybody have any ideas or seen this yet?

    ok. So after unsynching apps, re-authorizing iTunes, re-synching... The iPhone now can use the apps, but the store on the iPhone still will not let me hit the Ok button... So no updates for me

  • How can I restore App Store and apps

    How can I restore App Store and my purchased apps

    If you mean that you can't find the App Store app on any of your homescreens or app folders, and you can't find it via the spotlight search screen (swipe your first home screen to the right), then is it hidden by Settings > General > Restrictions > Installing Apps being set 'off' ? If it is hidden then unhide it and the app should then appear on your iPad's homescreen, and you can then re-download your apps via the Purchased tab in it.

  • App updates and App installations hanging after 5.1.1

    Very slow app installations and updates and freezing after 5.1.1 update. I have done everything as suggested on google. Anyone else had any luck?

    Having the same problem. AT&T iPad.  No help from anyone yet. :-/

  • Iphone 4 App Store and Apps

    hi everyone,
    I am iphone 4 16bg white color (ios 4.3.5 (8L1)) user. Recently, i experience that my apps updates does not download when I update it. Usually, when I go to app store and see some updates for my apps, i only need to choose "update all" option and input my password. i will be automatically sent out back to the background window and see my iphone downloading the updates for the apps. however, this time when choose to update my apps, i was sent out automatically back to the background window and see that the download bar under the apps not working at all. the bar will not full and just remain empty under the apps icon unless I go back to app store and choose update all once again. This happens quite often to me. Does anybody ever come across this too? Please help me on this. Sorry for my English. Thank you guys.

    If the open button actually opens the app, but you do not see that app on any of the home screens, go to Settings > General > Reset > Reset Home Screen Layout.
    If it does not open the App or if you still cannot find the app, go to Settings > General > Usage.  Locate the App on the list and delete the app.  Then you can re-download it from the App Store.

  • Using Google 2FA and app-specific password--can receive but not send

    I'm using Mail to check my Gmail account.  I use 2FA on my Google account and therefore use an app-specific password for Apple Mail.  I receive mail fine (although sometimes the message doesn't get pushed to Mail, it seems...maybe this is a different issue) but I can't send a message.  I get this error: 
    ...but I've already entered my app-specific password and there's nowhere to enter it.  The link in the error message is dead. 

    If you've activated 2-step verification, you need to generate an application-specific password in your Google account and enter it instead of the login password you use on the website.

  • HELP! how do i set up my internet so i can use BB messenger and Apps world?!

    right. ive looked everywhere on the internet for help and i cant find what im looking for. i phoned up Vodafone and asked for the Blackberry Internet Service and they added it to my contract.. 
    but now im stuck. i know that it has to say GPRS or something in the corner, and mine only says GSM, so first i want to know how to change this?
    second,  when i click Setup>Set Up Wizard> Email Setup  im sure theres meant to be an option to make a new address? but mine only says "i want to use a work email account with a Blackberry Enterprise Server" and when i click next it asks for an activation password ?
    i also tried to set it up on the blackberry site, and it asks for me to first choose my wireless service provider from a list of one.. how do i find out which one it is? and the only options are canada and united states.. i live in the UK! 
    also, i read something about "host routing table"?
    and when i click this and try to register an account it says "registration message queued. it will be sent once data coverage is available" whats this mean?
    THANK YOU SO MUCH FOR ANYONE WHO HELPS ME!

    Syman wrote:
    second,  when i click Setup>Set Up Wizard> Email Setup  im sure theres meant to be an option to make a new address? but mine only says "i want to use a work email account with a Blackberry Enterprise Server" and when i click next it asks for an activation password ?
    That simply indicates that your Vodafone account is not yet provisioned with the BlackBerry Data Plan.
    Try this:  With the BlackBerry device powered ON, remove the battery a few seconds and then reinsert the battery to reboot.
    Now, try the personal email setup again.
    If still no personal email setup, you need to call Voda and get an ETA on the provisioning.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • App Store and apps can't verify account on Mavericks

    MacBook Pro (13 mid 2012), 2.5ghz Intel i5, 8GB, OS X Yosemite 10.10.1
    I can not open any purchased apps or log on to the app store on my macbook only. I am able to log into iTunes just fine. And am able to use my account for the app store on my iPhone. When I try to use the App Store it tells me that my device needs to be verify. But it refuses to accept the password that I enter. I have tried to turn off wi-fi to test that and I have also restarted a couple times. Any help is appreciated.

    called apple. they helped me solve the problem. We dumped the plist and it was fixed.

  • NOT RESOLVED - SCOM 2012 R2 - App Advisor and App Diagnostics Issue

    Hi there!
    Here is our scenario: SCOM 2012 R2 is deployed in the environment
    SCOM - Management Server and SCOM Management Console.
    SQLOD - SQL 2012 Operational Database
    SQLDW - SQL 2012 Data Warehouse Database, SQL Reporting Services, SCOM Reporting, SCOM Web Console.
    Problem: SCOM Administrator is able to open SCOM Application Advisor,  SCOM Application Diagnostics and SCOM Web Console from any computer only after the SCOM Application Advisor,  SCOM Application Diagnostics and SCOM Web Console are opened
    from SQLDW (i.e. after opening them from the place where they were originally installed). The errors message prompts to retry after adding the user to the proper groups for SCOM Application Advisor and SCOM Application Diagnostics. SCOM Web Console prompts
    the user to login.
    Workaround: Open SCOM Application Advisor,  SCOM Application Diagnostics and SCOM Web Console on SQLDW (i.e. after opening them from the place where they were originally installed) and everything works fine.
    Question: What is causing the issue and how to fix it?
    Many thanks, in advance!

    I followed the article and it did not fix the issue.
    Here are additional details:
    There is only one user who does not experience the issue and it is a user under whose credentials the SCOM was installed AND that user has to login from the local network. If this users tries to connect over VPN he receives the same error.
    Here are errors when Test1 user logs in:
    Application Advisor (Enabled authentication: Windows Authentication, Forms Authentication, ASP.NET Impersonation):
    Authentication error
    User account: DOMAINNAME\Test1
    This user account does not have sufficient rights to use Application Advisor.
    Ask your administrator to add this user account to the Operations Manager Report Operators role, and then try again. 
    Application Diagnostics (Enabled authentication: Windows Authentication, Forms Authentication):
    Access denied 
    User account: DOMAINNAME\Test1
    This user account does not have sufficient rights to use Application Diagnostics.
    Ask your administrator to add this user account to the Operations Manager Application Monitoring Operators role, and then try again.
    Operations Manager Web Console (Enabled authentication: Windows Authentication):
    Prompted for credentials with error:
    The user credentials are invalid or user does not have permissions to access the application.
    Please provide the following information to the support engineer if you have to contact Microsoft Help and Support :
    Microsoft.EnterpriseManagement.Presentation.Security.ConnectionSessionAccessDeniedException: The user access is denied.
    This error reappears no matter whose credentials are entered. Even the SCOM Installer's credentials generate Error 3 when entered at the time when Test1 user is logged on.
    App Pools:
    OperationsManager - 4.0; Integrated; ApplicationPoolIdentity; 1 application
    OperationsManagerAppMonitoring - 4.0; Classic; NetworkService; 2 applications
    OperationsManagerMonitoring View - 2.0; Classic; NetworkService; 1 application
    Added *://*.domain.local zone to the trusted zone in the Internet Explorer.
    Please help!!!!

Maybe you are looking for

  • Someone has gotten ahold of my account!

    For the last couple of months I've been trying to download apps and when I tried to download one, put my password in and it says it's incorrect, and I should reset my password. I thought nothing of it, just thinking maybe an expired password, or they

  • Help with my website - the divs arent holding the text correctly

    hi i have included the html file of my website all of a sudden the text is not staying in the borders, the green border has text and used to move down to the next line and now doesnt can anyone also advise why when you press sapce it jumps down the p

  • MIRO find my user-exit

    Hi all, in development environment my customer use MIRO, when we want to save the invoice a message appears when the system check datas, when i click on Message button it's a specific message ( ZFI_CLP006), my customer want to delete this check it's

  • Why is 2.0.1 so bad.. Isnt this tested before release...

    How can it be so bad for such a minor release. It now takes much longer to do simple tasks.. seems that switching apps is slower. Backing up is taking significantly longer also...

  • HT201210 my phone wont sync as it says there is a missing file?

    My phone won't sync as it says it has a missing file. I just tried to update the latest operating system to save and update all my iphone data, it said it has incurred an unknown error & I need to restore my phone to original settings.... won't I los