InDesign: Remove hyphenation from all paragraph styles

Hi,

Ever get a template from a designer, or even a file, and late in the game, at the 11th hour, have your client request to have hyphenations removed?

Here is an Applescript that can handle that:

tell application "Adobe InDesign CS3"
if (count documents) is not equal to 0 then
my myHyphenations()
else
display dialog "Please open a document and try again."
end if
end tell

on myHyphenations()
display dialog "Do you want to turn hyphenation for all paragraph styles on or off?" buttons {"On", "Off"} default button 2
if the button returned of the result is "Off" then
tell application "Adobe InDesign CS3"
tell active document
set myParStyles to every paragraph style
--don't need application default pstyles
set myParStyles to items 3 thru (count of myParStyles) of myParStyles
repeat with aParStyle in myParStyles
set hyphenation of aParStyle to false
end repeat
end tell
end tell
else
tell application "Adobe InDesign CS3"
tell active document
set myParStyles to every paragraph style
set myParStyles to items 3 thru (count of myParStyles) of myParStyles
repeat with aParStyle in myParStyles
set hyphenation of aParStyle to true
end repeat
end tell
end tell
end if
end myHyphenations

As you can see, this only works on one document at a time, but you could tweak it if you like.

I just added a widget for Box.net file sharing, so if all you want is the script as an applet, just download it from there.

See ya soon.

Gregory Ledger

Advertisements

About this entry