Article View: adobe.scripting.indesign
Article #17206Re: (AS) OT fractions feature?
From: Eric McManus
Date: Tue, 24 Jun 2003 18:29
Date: Tue, 24 Jun 2003 18:29
20 lines
1953 bytes
1953 bytes
Well, here it is: my first actually useful (rather than just educational) script. It takes a document formatted in an OpenType font, which contains a character style with the fraction feature turned on, and makes all the fractions (with up to a 2-digit numerator and 3-digit denominator) appear all fancy-like.
tell application "InDesign 2.0.2"
--clear find/change attributes
set change preferences to nothing
set find preferences to nothing
set myDocument to active document
tell myDocument
set myFractionStyle to character style "fraction"
tell stories
search stories of myDocument for "^9/^9" with change attributes {applied character style:myFractionStyle}
search stories of myDocument for "^9/^9^9" with change attributes {applied character style:myFractionStyle}
search stories of myDocument for "^9/^9^9^9" with change attributes {applied character style:myFractionStyle}
search stories of myDocument for "^9^9/^9^9" with change attributes {applied character style:myFractionStyle}
search stories of myDocument for "^9^9/^9^9^9" with change attributes {applied character style:myFractionStyle}
end tell
end tell
end tell
Technical Details
Message-ID:
<1de9a683.8@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de9a683.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,f332520123d2c8c6 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-06-24 11:38:24 PST From: "Eric McManus" <emcmanus@adobe.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: (AS) OT fractions feature? Message-ID: <1de9a683.8@WebX.la2eafNXanI> Date: Tue, 24 Jun 2003 11:29:55 -0700 References: <1de9a683.-1@WebX.la2eafNXanI> Lines: 27 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit