Article View: adobe.scripting.indesign
Article #72Please help. Scripting change from CS2 to CS4
From: Cheri_McDannell
Date: Fri, 27 Mar 2009 15:32
Date: Fri, 27 Mar 2009 15:32
61 lines
4041 bytes
4041 bytes
I finally figured out how to write the script in InDesign CS2 and get it to format my schedule exactly as I needed it. We recently upgraded to CS4 and that script does not work any more. I would like to remove the old CS2 version but can't because I still need it to format this particular project. Here is the script I have from CS2
//NewFindChangeList.txt
//Data file for use with the TextCleanup.jsx script for InDesign CS2.
//
//
//
//The format of each record in the file is:
//findPropertieschangePropertiesrangedescription
//
//Where:
// is a tab character
//
//findProperties is a properties record (as text)
//
//changeProperties is a properties record (as text)
//
//range is either "all" or "once" (Use "all" with caution, as it is very easy to end up in an infinite loop.
//Never use "all" when finding/changing formatting.)
//
//description is a description of the find/change operation
//
//Very simple example:
//{findText:" "} {changeText:" "} Find all double spaces and replace with single spaces.
//
//More complex example:
//{findText:"^9^9.^9^9"} {applied character style:"price"} Find $10.00 to $99.99 and apply the character style "price".
//
//All InDesign search metacharacters are allowed in the findText properties; all but the wildcards are allowed in the changeText properties.
//
//More examples:
//Red text changes.
//{findText:"", strikeThru:true, fillColor:"Red"} {changeText:"", strikeThru:true, position:superscript, fillColor:"Black",} once Red strike.
//{findText:"", underline:true, fillColor:app.activeDocument.colors.item("Red")} {changeText:"", underline:true, position:superscript, fillColor:"Black",} once Red underline.
//{findText:"", fillColor:color "Red" or active document} {changeText:"", position:superscript, fillColor:"Black",} once Red text.
//Blue text changes.
//{findText:"", strikeThru:true, fillColor:color "Blue" of active document} {changeText:"", strikeThru:true, position:subscript, fillColor:"Black",} once Blue strike.
//{findText:"", underline:true, fillColor:color "Blue" of active document} {changeText:"", underline:true, position:subscript, fillColor:"Black",} once Blue underline.
//{findText:"", fillColor:color "Blue" of active document} {changeText:"", position:subscript, fillColor:"Black",} once Blue text.
//
{findText:"Evening"} {appliedCharacterStyle:"Evening/Weeks"} once
{findText:"Web Based"} {appliedCharacterStyle:"Evening/Weeks"} once
{findText:"Hybrid"} {appliedCharacterStyle:"Evening/Weeks"} once
{findText:"First 7.5 Weeks"} {appliedCharacterStyle:"Evening/Weeks"} once
{findText:"Second 7.5 Weeks"} {appliedCharacterStyle:"Evening/Weeks"} once
{findText:"First 10 Weeks"} {appliedCharacterStyle:"Evening/Weeks"} once
{findText:"Second 10 Weeks"} {appliedCharacterStyle:"Evening/Weeks"} once
{findText:"Middle 10 Weeks"} {appliedCharacterStyle:"Evening/Weeks"} once
{findText:"First 5 Weeks"} {appliedCharacterStyle:"Evening/Weeks"} once
{findText:"Second 5 Weeks"} {appliedCharacterStyle:"Evening/Weeks"} once
{findText:"Third 5 Weeks"} {appliedCharacterStyle:"Evening/Weeks"} once
{findText:"First 8 Weeks"} {appliedCharacterStyle:"Evening/Weeks"} once
{findText:"Credits "} {changeText:"Credits"} all
{findText:"<text#>"} {changeText:"", appliedParagraphStyle:app.documents.item(0).paragraphStyles.item("Text#")} once
{findText:"<text#>"} {changeText:""} once
{findText:""} {changeText:"^t"}
{findText:"
Technical Details
Message-ID:
<59b86da1.-1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!news2.glorb.com!newshub.sdsu.edu!webcrossingShow Full Headers
Complete Article Headers
X-Google-Thread: f939a,34793d5935efbf32,start X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Cheri_McDannell@adobeforums.com Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!news2.glorb.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Please help. Scripting change from CS2 to CS4 Message-ID: <59b86da1.-1@webcrossing.la2eafNXanI> Date: Fri, 27 Mar 2009 08:32:59 -0700 Lines: 94 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit