Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Removing Ligatures Script

181 views
Skip to first unread message

Mark Elsner

unread,
Jan 8, 2003, 1:36:08 PM1/8/03
to
Is there a way to remove ligatures from all the styles in a document via a scrip? This would be for a Windows based machine. The document would be open and then you would just run the script to remove ligatures from the styles that were in the document.

Thanks

Mark

Olav Kvern

unread,
Jan 8, 2003, 3:42:47 PM1/8/03
to
Mark--

Something like this, I think.

Rem Remove ligatures from all paragraph and character styles
Set myInDesign = CreateObject("InDesign.Application.2.0")
Set myDocument = myInDesign.ActiveDocument
For myCounter = 1 To myDocument.ParaStyles.Count
Set myParaStyle = myDocument.ParaStyles.Item(myCounter)
If myParaStyle.Name <> "[No paragraph style]" And (myParaStyle.Ligatures = True Or myParaStyle.OTFDiscLig = True) Then
If myParaStyle.Ligatures = True Then
myParaStyle.Ligatures = False
End If
If myParaStyle.OTFDiscLig = True Then
myParaStyle.OTFDiscLig = False
End If
End If
Next
For myCounter = 1 To myDocument.CharStyles.Count
Set myCharStyle = myDocument.CharStyles.Item(myCounter)
If myCharStyle.Name <> "[No character style]" And (myCharStyle.Ligatures = True Or myCharStyle.OTFDiscLig = True) Then
If myCharStyle.Ligatures = True Then
myCharStyle.Ligatures = False
End If
If myCharStyle.OTFDiscLig = True Then
myCharStyle.OTFDiscLig = False
End If
End If
Next


Copy the text of the script out of this message and into a text editor, then save the file as plain text with the file extention ".vbs". Put the script in the ~/Program Files/Adobe/InDesign 2.0/Scripts folder, and you'll be able to run it from the Scripts palette.

Thanks,

Ole

Olav Kvern

unread,
Jan 8, 2003, 4:53:57 PM1/8/03
to
Dave--

Because it's faster. VB evaluating an "If" is very fast compared to ID changing a paragraph style or character style.

Thanks,

Ole

Dave Saunders

unread,
Jan 8, 2003, 4:40:41 PM1/8/03
to
Ole,

Why bother to test the current state? Why not just switch them off?

I guess it doesn't make a lot of difference.

Dave

Olav Kvern

unread,
Jan 8, 2003, 5:03:19 PM1/8/03
to
Dave--

It really depends on what you're doing (and on how much of whatever it is). I've noticed that changing paragraph and/or character styles is *much* slower than lots of other stuff.

Thanks,

Ole

Dave Saunders

unread,
Jan 8, 2003, 5:00:31 PM1/8/03
to
Ah. I've often wondered about that in my scripts. Is it worth checking or just doing it. Sometimes, for a script that's only going to be used once for a particular situation, it hardly matters, but other times efficiency is vital, of course.

Dave

Dave Saunders

unread,
Jan 8, 2003, 5:11:20 PM1/8/03
to
Yes, you're right, it is a slow process. Even in the UI you can see it. I have a document that has over 2500 text frames in it and any change of style in that document elicits a significant delay while all the affected paragraphs are sought out and updated.

Dave

Mark Elsner

unread,
Jan 9, 2003, 8:48:09 AM1/9/03
to
Great, thanks for the help it works perfectly.

Mark

Art Schneider

unread,
Jan 9, 2003, 12:52:59 PM1/9/03
to
Ole,

What an awesome script! Thanks for the file! It works great!

Art

Olav Kvern

unread,
Jan 9, 2003, 3:00:25 PM1/9/03
to
Art, Mark--

Glad to hear it works for you. Note that you can use it as a framework to change just about any paragraph or character style attribute you want.<g>

Thanks,

Ole

0 new messages