Re: Changing fonts (and faces) in InDesign paragraph & character styles
Re: Changing fonts (and faces) in InDesign paragraph & character styles
- Subject: Re: Changing fonts (and faces) in InDesign paragraph & character styles
- From: JF <email@hidden>
- Date: Wed, 01 May 2013 21:00:58 +0100
Hi Chris, thank you for your reply.
I have made some progress in my script, but I am not there yet.
I can address a single style, but have difficulties in telling
all the styles to loop and change IF the font name is "Helvetica
Neue LT". There are some styles which do not have this font and
I'd end up in even more of a mess if I change a style to the
wrong font and its attributes. I think this version managed to
avoid changing any character style which was not using Helvetica
Neue LT:
___________________________________
tell application "Adobe InDesign CS6"
tell character style "45 Light" of active document
-- tell selected item of active document
if applied font is "Helvetica Neue LT" then
set applied font to "Helvetica Neue LT Std"
if font style is "LT 65 Medium" then
set font style to "65 Medium"
end if
if font style is "LT 45 Light" then
set font style to "45 Light"
end if
if font style is "LT 46 Light Italic" then
set font style to "46 Light Italic"
end if
if font style is "LT 75 Bold" then
set font style to "75 Bold"
end if
if font style is "LT 55 Roman" then
set font style to "55 Roman"
end if
end if
set kerning method to "Metrics"
end tell
end tell
_______________________________
I'll try to adapt your loop to work in InDesign, but I am not
sure how I can call all the character styles one after the other.
The alternative (which I often use) is the semi manual approach:
select the style and tell it to change, but you can see in the
script above my attempt did not work (it is misplaced at the moment).
On 1/5/13 at 20:25, Chris.Paveglio@<hidden> (Chris Paveglio) wrote:
Hi JF,
It appears that you are probably pretty new to Applescript or programming.
You are going to have to work on some basics first.
You can loop through a list of objects like some styles like:
tell application "Adobe InDesign CS5"
tell document 1
set docCharStyles to every character style
repeat with aStyle in docCharStyles
tell aStyle
--<do some actions here>
end tell
end repeat
end tell
end tell
As far as changing something from one thing to another, you might have to
use a lot of lists or IF/ELSE statements to switch them. If you have a lot
of fonts that change from one style to another, it will be a big list of
IFs. There may be no way around having some kind of giant list of If this
font style then some other font style
If font style is "65 Medium" then
set font style to "75 Medium"
Else if font style is "85 Black" then
set font style to "86 Black Italic"
Else if font style is "77 Bold Condensed" then
set font..... Etc etc
Or
If (font style is "65 Medium") and (applied font is "Helvetica") then
--do things
--
Chris
_______________________________________________
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