Re: InDesign: determining bold/italic in text runs
Re: InDesign: determining bold/italic in text runs
- Subject: Re: InDesign: determining bold/italic in text runs
- From: "Reese, Stevan" <email@hidden>
- Date: Thu, 5 Apr 2007 20:22:43 -0700
- Acceptlanguage: en-US
- Thread-topic: InDesign: determining bold/italic in text runs
Sorry...
search paragraphs with find attributes {find text:"(tm)"} with change attributes {change text:"(tm)", applied character style:"superscript TM"}
On 04/05/07 8:21 PM, "Reese, Stevan" <email@hidden> wrote:
Does this point you in the right direction?
On 04/05/07 8:15 PM, "Jeff Jungblut" <email@hidden> wrote:
I've been using the following code to insert bold/italic codes into Quark text for web site posting.
I understand that InDesign doesn't support bold/italic as text attributes and instead relies on the font to support bold/italic variations. But is it possible to tell if a range of text has a bold or italic font applied, without having to check the font name and know in advance all the possible derivatives of Bold/Heavy/Demi/Thick/Medium/Oblique/Italic/Tilt/Slant/etc that may be available for the applied font? Does InDesign completely discard bold/italic tags when it imports from a Word doc and sets each styled text range to a different font?
tell document 1 of application "QuarkXPress"
tell story 1 of current box
set style of (last character of every paragraph) to plain
try
copy "<b><i>" to before (text style ranges whose style contains {on styles:{bold, italic}})
copy "</i></b>" to after (text style ranges whose style contains {on styles:{bold, italic}})
end try
try
copy "<b>" to before (text style ranges whose style contains bold)
on error
set boldcodes to false
end try
try
copy "<i>" to before (text style ranges whose style contains italic)
copy "</i>" to after (text style ranges whose style contains italic)
end try
if boldcodes is true then
copy "</b>" to after (text style ranges whose style contains bold)
end if
set theParas to text 1 of every paragraph
set theStyles to name of style sheet of every paragraph
end tell
end tell
stevan
b P Please consider the environment before printing this e-mail
stevan
b P Please consider the environment before printing this e-mail
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden