Home Categories Submit Republish Tools Links Credits Contact
Popular Articles
 
     
 
 Categories
 
 
Submit your articles online!

Finding And Changing Text Through InDesign Scripting

By: Christopher Mason

Published: November 1, 2009
Link To Article Link To Article  E-mail Article E-mail Article  Republish Article Republish Article
Adobe InDesign has long offered users the option of automating their workflows through scripting. Although scripts may be writing in AppleScript (Macintosh only) or VBScript (Windows only), the most satisfactory scripting language is the cross-platform, and very widely used, JavaScript. One of the simplest and yet most useful operations that can be accomplished using scripting is the automation of Find/Change. InDesign's Find/Change feature is one of the program's most powerful features and it is one of those features which can be fully automated by scripting. In fact, you can achieve a lot more through scripting than you can by manually performing a Find/Change operation.

There are three commands in the InDesign scripting framework for performing Find/Change operations: findText(), findGrep() and findGlyph(). A good deal can be accomplished using the straightforward findText() command. However, if you need to make fairly complex changes, and if you have the time and patience to find the right regular expression, you can use the findGrep() command which is designed for performing searches for regular expressions.

To script a Find/Change operation, you first of all need to set up the preferences that will be used when performing the Find or Change. First, you set the properties of the findChangeTextOptions object: parameters include caseSensitive, wholeWord, ignoreHiddenLayers and ignoreMasterPages. Next, you set up your findTextPreferences and changeTextPreferences parameters, the most important of which are findWhat and changeTo, respectively. It is also usually a good idea to clear out any preferences that may still be in play from a previous search. This is done by setting both the findTextPreferences and changeTextPreferences objects to nothing, using the commands: app.findTextPreferences = NothingEnum.nothing and app.changeTextPreferences = NothingEnum.nothing.

As well as this, the findTextPreferences and changeTextPreferences objects offer all of the formatting parameters normally available with text objects.

A popular exercise that we give to students attending our InDesign scripting courses is to create a script which searches for the name of a company within a document, changes the format of the text to look like a regular web hyperlink (blue, bold, underlined) and then makes it a hyperlink. To change the format of the text, we simply use the appropriate properties of the changeTextPreferences object, such as fillColor, fontStyle and underline.

More Information:

The writer of this article is a trainer and developer with a UK IT training company offering Adobe InDesign Classes as well as Photoshop training at their central London training centre.


Visitor Comments

Post Comment Post A Comment
What do you think about this article? Do you agree or disagree with it? Be the first to comment on this article, and share your thoughts with the world. No registration is required to post comments.

Article Icon Downloading Computer Software Off The Net
Everybody likes a freebie and that goes for users of computers too. Acquiring these free programs usually means copying them from a disk given away with a computer magazine or downloading computer software off
Article Icon Pre Viz: 4 Exclusive Benefits Of Digital Storyboarding
All over the Internet, storyboard examples offer a view of storyboarding as being paper storyboards or digital storyboards. By checking out the finished work of other directors, you can learn more about...
Article Icon What To Expect From Eset AntiVirus Software Suite
When it comes to a software removing any traces of even the latest virus or malware from a system, Eset is one product that gets a standing ovation. Malware or viruses can do considerable damage to...
Article Icon A Look At Beat Making Software
Creating your own unique style of music is easier than it has ever been with the introduction of beat making software. When an individual uses the most effective programs available, they can create beats...
Article Icon Some Great Ways That McAfee Total Protection Software Software Can Secure Your Computer
All of us worry about the threat of viruses to our computer. We spend so much time on our computers and have so much information stored on them that that loss or destruction of that information would be...
Article Icon Photo Edge Burn With Photoshop
I can imagine the confused look on your face right now. You may be wondering to yourself, "What in the world is photo edge burn, and why would I care?" Here we will explain what it is and break down why it can
Article Icon Advantages Experienced When Using Help Desk Software
There are countless benefits of using help desk software both in professional and personal settings. A person can accomplish many tasks very quickly if they are using this type of computer program....
Article Icon Film Storyboarding Software: Learn The Tricks Of Successful Documentary Storyboarding
Filming a great documentary needs great attention to detail -careful study, enthusiasm for the subject matter at hand, and painstaking planning can combine to create a memorable "slice of life" - one that...
Article Icon Content Is The Platform, Open Source Is The Medium, Search Is The Interface
First, Adobe, famous for tools for making your content look good - from Flash to Photoshop, from the hoary Postscript and its modern analogue, Acrobat PDF - is now investing aggressively in a content...
Article Icon The Apache Lucene Ecosystem: My View Of 2010
After a week off to enjoy time with my family, I thought I would kick off the last week of 2010 with a look back at the year as it relates to the Apache Lucene ecosystem.

Article Icon Microsoft Excel Training Guides You To Excellence
Microsoft Excel training trains you in using all those amazing features that help you make spreadsheets, present your data as a statistical analysis with the tools like graphs and legends, schematic...


Print This Article Print This Article
Add To Favorites Add To Favorites
Cite This Article Cite This Article
 
 
Home | Categories | Submit | Republish | Tools | Links | Credits | Contact | Privacy Statement | Terms Of Use
Copyright © 2012 InfoServe Media, LLC (DBA PopularArticles.com). All rights reserved.