How can I make a long list of search - replace only the master

Hello world

I had this script:

//---------------------------------------------------------------------------------------- -------------------------------

myDocuments var = app.documents.everyItem ();
var myLayers = myDocuments.layers.everyItem ();

Locked text on master blocks spreads are not affected.
If you want to unblock, please add something like this:

Unlock all elements of each document page on is spreading and Captain spreads (optional):
myDocuments.pageItems.everyItem (.locked = false);

var myPageItemsOnNormalSpreads = myDocuments.spreads.everyItem ().pageItems.everyItem ();

Unlock the layers (optional)
myLayers.locked = false;

Lock all elements of page level first on normal spreads
This leaves the elements on the page on unlocked master spreads:
myPageItemsOnNormalSpreads.locked = true;

Now for the GREP part:
app.findChangeGrepOptions.includeMasterPages = true;
app.findGrepPreferences = changeGrepPreferences = null;
app.findGrepPreferences.findWhat = "\\b20\\d+\\b";

Research on "all open document" level
Which returns an array of arrays:
var myTarget = myDocuments.findGrep ();

Flattening of myTarget Bay:
var flattenedFoundArray = [];

for (var n = 0; n < myTarget.length; n ++) {}
flattenedFoundArray = flattenedFoundArray.concat (myTarget [n]);
};

Change the content of the texts found in flat table:
for (var n = flattenedFoundArray.length - 1; n > = 0; n-) {}
flattenedFoundArray [n] .silence = String (Number(flattenedFoundArray[n].contents) + 1);
};

Unlock all objects on normal spreads:
myPageItemsOnNormalSpreads.locked = false;

Reset search GREP and edit the prefs:
app.findGrepPreferences = changeGrepPreferences = null;

//---------------------------------------------------------------------------------------- -------------------------------

made by Uwe

I change in this, to make a multi elements of search - replace only the master

//==============================================================================

myDocuments var = app.documents.everyItem ();
var myLayers = myDocuments.layers.everyItem ();

Locked text spreads masters frameworks are not affected.
If you want to unblock, please add something like this:

Unlock all items page of each document of spreads and master spreads (optional):
myDocuments.pageItems.everyItem (.locked = false);

var myPageItemsOnNormalSpreads = myDocuments.spreads.everyItem ().pageItems.everyItem ();

Unlock the layers (optional)
myLayers.locked = false;

Lock all elements of page level first on normal spreads
This leaves the elements on the page on unlocked master spreads:
myPageItemsOnNormalSpreads.locked = true;

Now for the GREP part:
app.findChangeGrepOptions.includeMasterPages = true;
app.findGrepPreferences = changeGrepPreferences = null;
app.findGrepPreferences.findWhat = "USA";

Research on "all open document" level
Which returns an array of arrays:
var myTarget = myDocuments.findGrep ();

Flattening of myTarget Bay:
var flattenedFoundArray = [];

for (var n = 0; n < myTarget.length; n ++) {}
flattenedFoundArray = flattenedFoundArray.concat (myTarget [n]);
};

Change the content of the texts found in flat table:
for (var n = flattenedFoundArray.length - 1; n > = 0; n-) {}
flattenedFoundArray [n] .silence = "CHINA";
};

Unlock all objects on normal spreads:
myPageItemsOnNormalSpreads.locked = false;

Reset search GREP and edit the prefs:
app.findGrepPreferences = changeGrepPreferences = null;


//---------------------------------------------------------------------------------------- -------------------------------

myDocuments var = app.documents.everyItem ();
var myLayers = myDocuments.layers.everyItem ();

Locked text spreads masters frameworks are not affected.
If you want to unblock, please add something like this:

Unlock all items page of each document of spreads and master spreads (optional):
myDocuments.pageItems.everyItem (.locked = false);

var myPageItemsOnNormalSpreads = myDocuments.spreads.everyItem ().pageItems.everyItem ();

Unlock the layers (optional)
myLayers.locked = false;

Lock all elements of page level first on normal spreads
This leaves the elements on the page on unlocked master spreads:
myPageItemsOnNormalSpreads.locked = true;

Now for the GREP part:
app.findChangeGrepOptions.includeMasterPages = true;
app.findGrepPreferences = changeGrepPreferences = null;
app.findGrepPreferences.findWhat = 'Washington DC';

Research on "all open document" level
Which returns an array of arrays:
var myTarget = myDocuments.findGrep ();

Flattening of myTarget Bay:
var flattenedFoundArray = [];

for (var n = 0; n < myTarget.length; n ++) {}
flattenedFoundArray = flattenedFoundArray.concat (myTarget [n]);
};

Change the content of the texts found in flat table:
for (var n = flattenedFoundArray.length - 1; n > = 0; n-) {}
flattenedFoundArray [n] .silence = "Beijing."
};

Unlock all objects on normal spreads:
myPageItemsOnNormalSpreads.locked = false;

Reset search GREP and edit the prefs:
app.findGrepPreferences = changeGrepPreferences = null;


//===============================================================================

only what I can do is to repeat and repeat again

is this another perfect solution to do?

Thank you

Teetan

Try this,

findChange("USA", "CHINA");
findChange("Washington DC", "Beijing");

function findChange (findWhat, changeContent){
    var myDocuments = app.documents.everyItem();
    var myLayers = myDocuments.layers.everyItem();
    //Locked text frames on master spreads are not touched.
    //If you want to unlock them you have to add something like this:
    //Unlock ALL page items in every document on spreads and master spreads (optional):
    myDocuments.pageItems.everyItem().locked = false;
    var myPageItemsOnNormalSpreads = myDocuments.spreads.everyItem().pageItems.everyItem();
    //Unlock the layers (optional)
    myLayers.locked = false;
    //Lock all first level page items on normal spreads
    //That leaves the page items on master spreads unlocked:
    myPageItemsOnNormalSpreads.locked = true;
    //Now for the GREP part:
    app.findChangeGrepOptions.includeMasterPages = true;
    app.findGrepPreferences = changeGrepPreferences = null;
    if(findWhat)app.findGrepPreferences.findWhat = findWhat;
    //Do the search on "all open document" level
    //That will return an array of arrays:
    var myTarget = myDocuments.findGrep();
    //Flattening the myTarget array:
    var flattenedFoundArray = [];
    for(var n=0;n=0;n--){
        if(changeContent)flattenedFoundArray[n].contents = changeContent;
        };
    //Unlock all objects on normal spreads:
    myPageItemsOnNormalSpreads.locked = false;
    //Reset GREP find and change prefs:
    app.findGrepPreferences = changeGrepPreferences = null;
}

Vandy

Tags: InDesign

Similar Questions

  • How can I make a long audio / voice recording

    How can I make a long audio / voice recording? I want to record my life story that will be a long recording.

    How can I make a long audio / voice recording? I want to record my life story that will be a long recording.

    ====================================
    The following article might be worth a visit:

    Windows 7 - audio record with sound recorder
    http://Windows.Microsoft.com/en-us/Windows7/record-audio-with-sound-recorder

  • How can I make sure my internet cable works even if the icon is not displayed by the clock

    I see the wireless connection icon, but I used to see one for the wired connection also. So where is it?

    How can I make sure my internet cable works even if the icon is not displayed by the clock?

    Click Start > Control Panel > network and Internet > network connections.

    Click with the right button on your Local network, and select Properties. In the window properties of LAN make you that these boxes are checked.

    [] Display the icon in the Notification area when connected

    [] Notify me when this connection is limited or no connectivity.

    Click [OK] and get out of here!

    Right-click on start and select Properties. On the taskbar and Start Menu click the taskbar tab, and then click the Customize in front of the Hide icon button inactive and it make sure that the option 'always show' for the local network is selected.

    HTH,

    NASS - http://www.nasstec.co.uk

  • How can I make an external (to another folder) link in the main menu?

    How can I make an external (to another folder) link in the main menu?

    Please see the discussion here Re: links to external websites Menu buttons>.

  • How can I make Windows 7 Explorer open my folder on the desktop instead of libraries?

    I can find solutions that have me enter the GUID (Globally Unique Identifiers) for My Documents/computer etc, but I want Windows Explorer to start on my office if possible.  Can someone explain how to do this?

    Three ways:

    1

    1.1. open Windows Explorer, select theyourusername file C:\Users\

    1.2 your desktop folder will appear in the right pane.

    1.3 with the right button on the desktop folder and select Create shortcut.

    1.4 you can now use this shortcut to open Windows Explorer on the desktop.

    - - - - - -

    2

    2.1 while on your desktop, right-click, select new, select shortcut.

    2.2 in the dialog box that appears, find the location with C:\Users\yourusername\Desktop tab, and then click Next

    2.3 and enter any convenient name for the shortcut.

    - - - - -

    3 [is perhaps the most convenient because it can be pinned to the start menu or the taskbar]

    3.1 while on your desktop, right-click, select new, select shortcut.

    3.2 in the dialog box that appears, find the location with C:\Windows\explorer.exe and then a space & then C:\Users\yourusername\Desktop tab, and then click Next

    3.3 then enter any convenient name for the shortcut.

    This type of shortcut can be pinned to the taskbar or the Start Menu.

  • How can I make my friends list in windows live for my viewing only and will not be shared with any of my friends

    I want that my list of contacts and friends to not be seen when people (including my friends) light up on my profile page on windows live or windows live messenger

    Hello

    they will help you with your questions/problems Messenger when repost you the link below in the Messenger forums

    http://windowslivehelp.com/product.aspx?ProductID=2

  • How can I make a phone call from Apple Watch after the update of the software lasted?

    I don't know how to make a phone call from my Apple Watch after this update. I need help

    Hello

    Under watch OS 3, the friends feature (which was available in previous versions) comes over and there is no direct replacement for it.

    When making calls or sending of new messages, contacts instead can be selected via the phone and Messages applications or using Siri:

  • How can I make windows play a sound when you press the SHIFT key

    My keyboard doesn't have a light to indicate when it is capitalized. He used to play a sound, but it is more the fact after that I said not to do. However, when entering passwords that are case sensitive, it gives the wrong password. Can someone tell me how to re - turn on the sound.
    Its a Logitech MK320 wireless

    Look in Control Panel > accessibility, and then click "make the keyboard easier to use." Check the box "turn ToggleKeys. This will produce a note when you press the lock keys. Or just check the other box beneath it. In this way, you can turn the tone on or off without having to return to these settings.

    SC Tom

  • How can I make my Macbook mid 2010 work better since the installation of El Capitan?

    I recently installed at El Capitan on my Macbook Pro (mid 2010) model. It was the first update, I did I think that since getting the computer years ago. Now, it runs as a shit and super frustrated. I ran a check being on it. See below. Can anyone help?

    EtreCheck version: 2.9.12 (265)

    Report generated 2016-06-04 14:51:03

    Download EtreCheck from https://etrecheck.com

    Time 04:25

    Performance: good

    Click the [Support] links to help with non-Apple products.

    Click [details] for more information on this line.

    Problem: Computer is too slow

    Description:

    Since the update to El Capitan, my computer is slow. It takes forever for applications to load, often freezes and often have beachball.

    Hardware Information:

    MacBook Pro (13-inch, mid 2010)

    [Data sheet] - [User Guide] - [warranty & Service]

    MacBook Pro - model: MacBookPro7, 1

    1 2.4 GHz Intel Core 2 Duo CPU: 2 strands

    4 GB of RAM expandable - [Instructions]

    BANK 0/DIMM0

    OK 2 GB DDR3 1067 MHz

    BANK 1/DIMM0

    OK 2 GB DDR3 1067 MHz

    Bluetooth: Old - transfer/Airdrop2 not supported

    Wireless: en1: 802.11 a/b/g/n

    Battery: Health = Normal - Cycle count = 440

    Video information:

    NVIDIA GeForce 320M - VRAM: 256 MB

    Color LCD 1280 x 800

    Software:

    OS X El Capitan 10.11.1 (B 15, 42) - time since started: about one day

    Disc information:

    Hitachi HTS545025B9SA02 disk0: (250,06 GB) (rotation)

    EFI (disk0s1) < not mounted >: 210 MB

    Macintosh HD (disk0s2) /: 249,20 (Go 46,10 free)

    Recovery HD (disk0s3) < not mounted > [recovery]: 650 MB

    MATSHITADVD-R UJ-898)

    USB information:

    Built-in ISight from Apple Inc..

    Card reader Apple

    Apple Inc. BRCM2046 hub.

    Apple Inc. Bluetooth USB host controller.

    Computer, Inc. Apple IR receiver.

    Apple Inc. Apple keyboard / Trackpad

    Configuration files:

    / etc/sudoers, 1242 but file size expected 2299

    Guardian:

    Mac App Store and identified developers

    Kernel extensions:

    / System/Library/Extensions

    com [no charge]. ZTE.driver.ZTELTEUSBCDCACMData (ZTELTEDriver_MacV5.0.1 - 2016-06-03) [Support]

    com [no charge]. ZTE.driver.ZTELTEUSBMassStorageFilter (ZTELTEDriver_MacV5.0.1 - 2016-06-03) [Support]

    com [no charge]. ZTE.driver.ZTEUSBCDCACMData (ZTEDriver_MacV1.3.12 - 2016-06-03) [Support]

    com [no charge]. ZTE.driver.ZTEUSBMassStorageFilter (ZTEDriver_MacV1.3.12 - 2016-06-03) [Support]

    com.sierrawireless.driver.SierraDIPSupport [no charge] (1.0.0.7 - 2016-06-03) [Support]

    com.sierrawireless.driver.SierraFSRSupport [no charge] (3.0.0.2 - 2016-06-03) [Support]

    [no charge] com.sierrawireless.driver.SierraHSRSupport (3.0.0.16 - 2016-06-03) [Support]

    com.sierrawireless.driver.SierraIPDirect [no charge] (1.1.5 - 2016-06-03) [Support]

    com.zte.LTEdriver.cdc_ecm_qmi [no charge] (1.0.2 - 2016-06-03) [Support]

    com.zte.LTEdriver.cdc_usb_bus [no charge] (1.0.2 - 2016-06-03) [Support]

    Launch system officers:

    [loaded] 7 tasks Apple

    [loading] 157 tasks Apple

    [operation] 57 tasks Apple

    [killed] 15 tasks Apple

    15 killed process lack of RAM

    Launch system demons:

    [loaded] 46 tasks Apple

    [loading] 149 tasks Apple

    [operation] 77 tasks Apple

    [killed] 13 tasks Apple

    13 killed process lack of RAM

    Launch officers:

    com [running]. Affinegy.InstaLANa.plist (2011-05-28) [Support]

    [loading] com.google.keystone.agent.plist (2016-03-06) [Support]

    [operation] com.sierrawireless.SwitchTool.plist (2010-09-08) [Support]

    Launch demons:

    [failure] com.adobe.fpsaud.plist (2016-03-19) [Support]

    [operation] com.fitbit.galileod.plist (2013-10-22) [Support]

    [loading] com.google.keystone.daemon.plist (2016-03-06) [Support]

    [loading] com.microsoft.autoupdate.helpertool.plist (2015-11-11) [Support]

    [loading] com.microsoft.office.licensingV2.helper.plist (2015-10-08) [Support]

    [operation] hdjsd.plist (2014-08-02) [Support]

    User launch officers:

    [loading] com.adobe.ARM. [...]. plist (2014-11-20) [Support]

    com.apple.CSConfigDotMacCert [fail]-[...] @me.com - SharedServices.Agent.plist

    [loading] com.macpaw.CleanMyMac3.Scheduler.plist (2016-06-04) [Support]

    [operation] com.spotify.webhelper.plist (2016-06-03) [Support]

    Items in user login:

    Safari application (/ Applications/Safari.app)

    GrowlHelperApp application (/ Library/PreferencePanes/Growl.prefPane/Contents/Resources/GrowlHelperApp.app)

    The Belkin router monitor application (~ /.) Trash/Belkin/Belkin Monitor.app router)

    Dropbox application (/ Applications/Dropbox.app)

    Fitbit connect Menubar Helper Application (/ Applications/Fitbit Connect.app/Contents/MacOS/Fitbit Connect Helper.app of the menu bar)

    Hidden Google Chrome application (/ Applications/Google Chrome.app)

    Hidden Spotify Application (/ Applications/Spotify.app)

    Hidden AdobeResourceSynchronizer Application (/ Applications/Adobe Reader.app/Contents/Support/AdobeResourceSynchronizer.app)

    CleanMyMac 3 Application Menu (~ /.) Trash/CleanMyMac 3.app/Contents/MacOS/CleanMyMac 3 Menu.app)

    Other applications:

    com [running]. Growl.GrowlHelperApp.67232

    com.adobe.Reader.45472 [loading]

    [ongoing] com.evernote.EvernoteHelper

    [ongoing] com.fitbit.GalileoMenubar.67552

    com.google.Chrome.61792 [loading]

    [ongoing] com.microsoft.Office365ServiceV2.79712

    com.microsoft.Word.77152 [loading]

    com.Microsoft.AutoUpdate.FBA.77792 [loading]

    [ongoing] com.Microsoft.ErrorReporting.79072

    com.spotify.client.61472 [loading]

    [ongoing] JP.co.Canon.cijscannerregister.74912

    [loading] 407 tasks Apple

    [operation] 170 tasks Apple

    [killed] 26 tasks Apple

    Plug-ins Internet:

    o1dbrowserplugin: 5.41.3.0 - 10.8 SDK (2015-12-16) [Support]

    Default browser: 601 - SDK 10.11 (2015-10-18)

    Flip4Mac WMV Plugin: 2.4.0.11 (2012-01-09) [Support]

    AdobePDFViewerNPAPI: 11.0.11 - SDK 10.6 (2015-06-29) [Support]

    FlashPlayer - 10.6: 21.0.0.197 - SDK 10.6 (2016-03-25) [Support]

    Silverlight: 4.0.60531.0 (2012-01-09) [Support]

    QuickTime Plugin: 7.7.3 (2015-10-18)

    Flash Player: 21.0.0.197 - SDK 10.6 (2016-03-25) obsolete! Update

    googletalkbrowserplugin: 5.41.3.0 - 10.8 SDK (2015-12-12) [Support]

    iPhotoPhotocast: 7.0 (2010-11-25)

    AdobePDFViewer: 11.0.11 - SDK 10.6 (2015-06-29) [Support]

    JavaAppletPlugin: 15.0.1 - 10.11 (2013-10-11) check the version of the SDK

    3rd party preference panes:

    Flash Player (2016-03-19) [Support]

    Flip4Mac WMV (2011-07-01) [Support]

    Growl (2013-08-26) [Support]

    Time Machine:

    Time Machine not configured!

    Top of page process CPU:

    73% spotify Helper (2)

    22% kernel_task

    19% Google Chrome Helper (9)

    5% WindowServer

    4% mdworker (9)

    Top of page process of memory:

    897 MB Google Chrome Helper (9)

    506 MB kernel_task

    176 MB Google Chrome

    127MO Finder

    Mdworker (9) 98 MB

    Virtual memory information:

    57 MB free RAM

    4.19 GB used RAM (901 MB cache)

    380 MB used Swap

    Diagnostic information:

    June 4, 2016, 14:21:54 ~/Library/Logs/DiagnosticReports/Mail_2016-06-04-142154_[redacted].crash

    /Applications/mail.app/Contents/MacOS/mail

    June 4, 2016, 13:58:30 ~/Library/Logs/DiagnosticReports/Microsoft Word_2016-06-04-135830_ [redacted] .crash

    / Word.app/Contents/MacOS/Microsoft applications/Microsoft Word

    June 4, 2016, 11:44:41 ~/Library/Logs/DiagnosticReports/SystemUIServer_2016-06-04-114441_[redacted].cr ash

    /System/Library/CoreServices/SystemUIServer.app/Contents/MacOS/SystemUIServer

    3 June 2016, 18:13:38 ~/Library/Logs/DiagnosticReports/SystemUIServer_2016-06-03-181338_[redacted].cr ash

    3 June 2016, 12:56:25 self test - passed

    What I would do is to backup your data on an external drive,

    Restart the mac while holding the ⌘R until the apple logo appears and wait until the boot process is completed. It may take more time to start.

    Once in recovery mode select your preferred language, click on update or reinstall a copy of OS X., select your drive and wait for the process to do. (Also click on continue and accept all that)

    One time did Shutdown and finished reinstall then start in recovery mode again (⌘R) and then click on restore Time Machine backup and then use the backup that you have saved on your external drive. Do you know how to use time machine to back up data in system preferences?

    Best regards

    A

  • How can you make records open or preview when plane of the mouse on them?

    I would like to find a way to create a folder, in particular on the desktop, that would popup or show somehow its content just with the mouse hover to say a second or something.  Something similar to how the start menu can transform files to the right in the menus that can be done from there.  I want to put several shortcuts in a folder to save space on my desk but I want to show them with just a mouse pointer so that its essentially the same functionality that have it on the desktop without extra clicking involved or appear a window of the Explorer.

    Hello

    Unfortunately, this is not possible. If we hover over a folder or a file, it will show us the default information that is by design. You can publish your comments on the following link:

    http://mymfe.Microsoft.com/Windows%207/feedback.aspx?formid=195

    Thank you!

  • How can I make Cloud Creative run in English?  Not the apps that install, CC itself.

    Hello

    I downloaded CreativeCloudSet - Up.exe since the U.S. site.

    But when I run it it works in French.

    I changed the language setting to English.  My profile is set to English.

    But it still works in French.

    What can I do to make the CC switch to the English language?

    uninstall your current application which uses incorrect language.

    then follow these instructions to install the correct language: https://helpx.adobe.com/creative-cloud/kb/change-installed-language.html

  • How can I make an availability calendar as they use in the touroperater Web sites. A calendar when you click a button, it displays the dates available for booking? Or do I need a database for that?

    I m busy doing a site for a touroperater. I'm trying to figure out how to do an availability calendar. When you click a button, it will display a calendar where you can choose a date where you wish to arrive and when you leave. When you´ve does this, it will show you whether or not your choisen dates are available.

    I hope I have made myself clear with this question.

    Hello

    Take a look at this topic, discussing the same stuff,

    Appointments available for a site of Muse?

    Please let us know if yous until cases of doubt.

  • How can I make my default Ethernet instead of wifi only iMac

    My default wifi network preferences. How do for the ethernet connection either by default and no Wifi

    Go to system/network preferences, click on the gear down, and then select the value of Service order. Ethernet to slide up.

  • How can I find online a list of specific changes in the latest version of Firefox?

    site design Web current mozilla eliminated (or hidden beyond my ability to find) information on what has changed in the last published Firefox. The only thing I can find on "what's new" is a video of bland, generic "Firefox 3.6 is wonderful."

    == The last version (3.6.4?) first time

    http://www.Mozilla-Europe.org/en/Firefox/3.6.6/releasenotes/

  • I made a game on CC Flash Professional on a MacBook Pro, how can I make a button so that when you finish the game you can close? (An exit button)

    Captura de pantalla 2016-01-27 a las 8.03.59 AM.png

    you publish the html/swf files that open in a web browser and you want to close the html page?

    If so, you can do that except if you opened your page html with javascript.  in this case, you can close it with javascript (and the class externalinterface in your SWF)

Maybe you are looking for

  • several pages of options

    Is it possible to open several pages at once (like a button at home), but select / sort under different themes. for example a click opens the tabs all financial, another opens, sports, etc. Consider that I want to sort these subjects the as a way to

  • Problem with new Skype updated for iPad 2 version 4.0.1325

    Since the upgrade to the new version, I was not able to do a video Skype or voice call on my iPad 2 anyone else having trouble? I am able to send messages from Skype.

  • Want to m6 - on keyboard num lock button

    M6 - envy I can't tell when the num lock key is on when I use the keyboard on the right side. This creates a problem when you type the number of password and I need to stop and remember to use the keys on the top. How will I know if it's on or not? N

  • WAAS for RADIUS and Windows Server 2012 NPS server configuration

    I have trouble getting our WAAS to authenticate devices and connection via RADIUS.  Running NPS on Windows Server 2012.  Confirmed that my device WAAS can ping the IP address of the RADIUS server.  Using the attribute Type of administrative service u

  • 3007WFP - cannot change the resolution of 1280 x 800?

    Hi all My monitor was turned off for about a year, and recently I plugged it in and I can not change the resolution to anything other then 1280 x 800, which now is also marked as recommended (not true in the past). Whenever I try to change I get diff