{"id":21602657,"url":"https://github.com/ff6347/batch-find-and-replace","last_synced_at":"2025-04-11T02:33:53.228Z","repository":{"id":40308478,"uuid":"8922996","full_name":"ff6347/batch-find-and-replace","owner":"ff6347","description":"This is a Adobe InDesign script for batch processing FNR xmls","archived":false,"fork":false,"pushed_at":"2022-06-18T23:06:49.000Z","size":1644,"stargazers_count":18,"open_issues_count":9,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-24T23:51:34.900Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ff6347.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-21T06:58:45.000Z","updated_at":"2023-08-23T06:09:47.000Z","dependencies_parsed_at":"2022-08-09T17:01:03.643Z","dependency_job_id":null,"html_url":"https://github.com/ff6347/batch-find-and-replace","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ff6347%2Fbatch-find-and-replace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ff6347%2Fbatch-find-and-replace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ff6347%2Fbatch-find-and-replace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ff6347%2Fbatch-find-and-replace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ff6347","download_url":"https://codeload.github.com/ff6347/batch-find-and-replace/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248329905,"owners_count":21085616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T19:14:00.290Z","updated_at":"2025-04-11T02:33:53.204Z","avatar_url":"https://github.com/ff6347.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"batch-find-and-replace\n======================\n\nThis is a Adobe InDesign script for batch processing find and replace xmls. You can process\nGREP, TEXT, GLYPH and OBJECT searches.  \n@author: fabiantheblind  \n@version: 0.1.4  \n\n\u003c!-- toc --\u003e\n\n* [Download](#download)\n* [Purpouse](#purpouse)\n* [files](#files)\n* [prerequisites](#prerequisites)\n* [Usage](#usage)\n* [TOML](#toml)\n  * [MUST HAVE Settings](#must-have-settings)\n  * [CAN HAVE Settings](#can-have-settings)\n* [FAQ](#faq)\n* [Version History](#version-history)\n* [To Dos](#to-dos)\n* [develop](#develop)\n* [License](#license)\n\n\u003c!-- toc stop --\u003e\n\n##Download  \nI know people don't want to read a lot - so here is a direct link to the [release package of version 0.1.4](https://github.com/fabiantheblind/batch-find-and-replace/releases/download/v0.1.4/batch-find-and-replace.v0.1.4.zip)\n\nThanks go to:   \n- [Tom's Obvious, Minimal Language](https://github.com/mojombo/toml) By [Tom Preston-Werner](https://github.com/mojombo)  \n- [toml.js]( https://github.com/JonAbrams/tomljs) by [JonAbrams](https://github.com/JonAbrams)  \n- [JsonDiffPatch.js](https://github.com/benjamine/JsonDiffPatch) by [benjamine](https://github.com/benjamine)   \n\nWithout these three open source projects this would not be possible.\n\n##Purpouse\nWhile creating books in InDesign with several documents we always come across some find change queries that need to be used again, and again, and again. To make this process easier you can just grab their names and put them into a list. The script will than try to precess all your queries in one click.  \n\n##files  \nIn the folder __dist__ you can find the full script (batch-find-and-replace.jsx) with the libraries enclosed and an example toml file (batch-find-and-replace.toml) or use the link from the download section. This is all you need to get started right away. Place them both into your [Scripts Panel](http://help.adobe.com/en_US/indesign/cs/using/WS0836C26E-79F9-4c8f-8150-C36260164A87a.html#WSDCB06999-2544-48c9-B348-888301FC6BA0a)  \n\n##prerequisites\n1. make sure you have a toml file.\n2. make sure the toml file is next to the script.\n3. make sure the toml file has the right formatting (see below in section TOML)\n4. if you want the script to autoexecute (without toml file selection), make sure the .toml file has the right name: \"batch-find-and-replace.toml\"\n5. make sure your fcqueries work right \n\n##Usage\n- Place the script and the toml file into your [Scripts Panel Folder](http://help.adobe.com/en_US/indesign/cs/using/WS0836C26E-79F9-4c8f-8150-C36260164A87a.html#WSDCB06999-2544-48c9-B348-888301FC6BA0a)  \n- define some find and change queries and save them via the [InDesign dialogue](http://help.adobe.com/en_US/indesign/cs/using/WSFB3603CC-8D84-48d8-9F77-F3E0644CB0B6a.html#WS293D91C6-1153-4f92-A260-24B1A59E10B4a).\n- get the xml file names and add them to the __\"batch-find-and-replace.toml\"__ file in the right spot. text search goes into `text.files = []`, grep search goes into `grep.files = []` and so on. Make shure to remove the .xml from the filename. You can find these files on:\n- - __Mac OS__ Users\\[username]\\Library\\Preferences\\Adobe InDesign\\[Version]\\[Language]\\Find-Change Queries\\[query type]  \n- - __Windows XP__ Documents and Settings\\[username]\\Application Data\\Adobe\\InDesign\\[Version]\\[Language]\\Find-Change Queries\\[query type]  \n- - __Windows Vista and Windows 7__ Users\\[username]\\AppData\\Roaming\\Adobe\\InDesign\\[Version]\\[Language]\\Find-Change Queries\\[query type]  \n- the .toml file should be located next to the script file and have the  appropriate name (batch-find-and-replace.toml). If so the script wont ask for the toml file and process the data right away. If not the script will ask you to select the .toml file.\n- Thats it. Watch the magick happen.\n\n##TOML\n[Tom's Obvious, Minimal Language](https://github.com/mojombo/toml) is a simple markup language that makes settings human readable. It is still in development and may change a lot. But still. It is a pretty easy language and can be learned by anyone.  \nThe basic toml filer looks like this:  \n\n    # these are the basic settings\n    # the MUST be there\n    do_text = true\n    do_grep = true\n    do_glyph = true\n    do_object = false\n    do_all_docs = true\n    # now the file names\n    # they have to be in one line\n    # the toml specs say you can break lines in arrays\n    # but the toml.js does not allow that at the moment\n    [text]\n    files = [\"my_first_text_find_and_change\",\"another one\"]\n    [grep]\n    files = [\"somegrepsearch\", \"find tabs\", \"something else\"]\n    [glyph]\n    files = []\n    [objects]\n    files = []\n\n###MUST HAVE Settings\nWith the `do_text`, `do_object`, `do_grep` and `do_glyph` you can define if the script should do the corresponding find and replace. Set them to `true` or `false`.  \nWith the `do_all_docs` setting you can define to use just the front most document or all open documents. Set it to `true` if you want to process all open documents.  \n\n###CAN HAVE Settings\nIn the `[text]`,`[grep]`,`[glyph]` and `[objects]` areas you can define the filenames that should be processed. Make sure the filenames are written right. If there is a file mentioned that does not exist the script will throw an error. It will try to process all the .xml files it can find. __!IMPORTANT!__ you MUST remove the .xml from the filename in the list as shown above.\n\n##FAQ  \nNothing yet. Feel free to ask and report issues ;)  \n\n##Version History  \n- 0.1.4 fixed typo. Do all docs can hang itself when having to many files\n- - maybe we should switch to book usage instead\n- 0.1.3 working on do all docs. more grunt\n- 0.1.2 working on do all docs. added grunt\n- 0.1.1 Added do all docs feature  \n- 0.1 initial release  \n\n##To Dos  \n\n- Make it work with InDesign Books or an folder of InDesign docs.  \n- add support for several docs\n\n\n##develop  \n\nIf you want to develop on this project fork it or clone it with git\n\n    git clone https://github.com/fabiantheblind/batch-find-and-replace.git\n    cd batch-find-and-replace\n\n\nIn the __src__ folder you will find the development files. The libraries are external and enclosed in the repository as submodules. If you want to set up these you have to run first:  \n\n    git submodule init  \n\nThan update the submodules with  \n\n    git submodule update  \n\nSee the progit documentation on submodules [here](http://git-scm.com/book/ch6-6.html).\n\nInstall [nodejs and npm](https://gist.github.com/isaacs/579814) the way you like it.  \n\nTo build the release script with all files put together I use [grunt](http://gruntjs.com/). install this as well.  \n\nThen run\n\n    npm install   \n    \nin the root of the project.  \nThen run grunt  \n\n    grunt  \n\nThis should build the whole script into the __dist__ folder.  \n\n    grunt dev  \n\nThis should run a watch task and compile your script everytime you change something.  \n\n##License\nAll code is under MIT License\nCopyright (c)  2013 - 2014 Fabian \"fabiantheblind\" Morón Zirfas  \nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software  without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to  permit persons to whom the Software is furnished to do so, subject to the following conditions:  \nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  \nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A  PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  \n\nsee also http://www.opensource.org/licenses/mit-license.php\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fff6347%2Fbatch-find-and-replace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fff6347%2Fbatch-find-and-replace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fff6347%2Fbatch-find-and-replace/lists"}