ExtendScript of the Week: “Change Styles – (Para/Char/Table)”Wednesday, October 5 2011 @ 4:28 PM, By bharatp
This week in “Extend Script of the Week” initiative we will showcase an extend script which will Find/Change paragraph tags,character tags and table formats on the body page of the document . This script demonstrates one of the several work flows where Extend Script can be used to do tasks in an intuitive and easy way. The script works on Book as well as FM/MIF files.
Information about the script :
- On running the script an UI appears.
- This UI contains three radio buttons namely ‘Para Style’,'Char Style’ and ‘Table Style’ and two buttons ‘Change’ and ‘Cancel’.
- You can choose the style to be changed by clicking on the appropriate radio button and the FIND and CHANGE dropdowns are populated by the styles existing in the active document or if run on a book the styles are taken from the first non generated file in the book.
- Eg : If you run the script on the attached Sample_Book.book/Doc1.fm then choose ‘Para Style’ radio button.
- Now choose ‘NewParaFormat-Blue’ in the FIND dropdown .
- Choose ‘NewParaFormat-Red’ in the CHANGE dropdown.
- Click on Change button.
- Now the script will iterate through all paragraphs of all components of the book and wherever the paragraph format is ‘NewParaFormat-Blue’ ,it is changed to ‘NewParaFormat-Red’.
- Similarly you can change character formats and table formats in a book or document.
- After changing the style ,an alert will appear informing the user about the number of changes in the operation.
Steps to Install
- Download the zip file from ChangeStyles
- Unzip the files and copy “ChangeStyleMenu.jsx” and “ChangeStyle” folder in startup folder located at “C:\Program Files\Adobe\AdobeFrameMaker10\startup”
How to use the Script?
- Launch FrameMaker
- Open a Book File or FM/MIF File
- Run Change Styles from “File -> Utilities -> Change Styles…“
- This will run the script and ask you for inputs to change the style.
- Choose the style to be changed in ‘Find’ dropdown.
- Choose the style to be applied in ‘Change’ dropdown.
- Click on Change button.
- If the script is run on an open FM/MIF file the styles would be changed without saving the document.
- If the script is run on a Book , all the FM/MIF components which are closed are opened invisibly, the styles are changed and then the files are closed after saving.
I hope this will prove useful to many folks and you can add extra functionality as per your requirements to these scripts to make it even more powerful
(Resources: ChangeStyles )