this is a perfect example of how becoming familiar with applescript will save you (well, at least your time). just last week a new problem presented itself. artwork for thirty signs had to be sent to a signwriter who required all text be converted to outlines.
now that’s not too difficult — select all (command-a), create outlines (command-shift-o), repeat for remaining 29 pages. but, when you know a little applescript (and when you know you’ll be doing this for future projects for the same signwriter) it makes sense to create an automated solution.
if you check the scripting dictionary you’ll see that the command create outlines can address a whole bunch of stuff — characters, words, lines, stories, text frames, etc. the first attempt at this script addressed stories :
tell application "Adobe InDesign CS4"
tell active document
tell every story
create outlines
end tell
end tell
end tell
… and got more complex with each attempt :
tell application "Adobe InDesign CS4"
tell active document
repeat with thisStory in every story
tell thisStory
create outlines
end tell
end repeat
end tell
end tell
tell application "Adobe InDesign CS4"
tell active document
repeat with x from (count every story) to 1 by -1
tell story x
try
create outlines with delete original
end try
end tell
end repeat
end tell
end tell
these sort of worked, kind of ok, some of the time — in other words, they were bloody useless.
so it made sense to try a different tact — surprisingly, perhaps (or perhaps not), this simple variation of the original script works much better :
tell application "Adobe InDesign CS4"
tell active document
tell every text frame
create outlines
end tell
end tell
end tell
so far, only one other hassle has presented itself — groups. applescript doesn’t recognise text frames if they are part of a group (unless you specify to check inside groups). to check this for yourself, create an InDesign document with three text frames — group two of the text frames together — then run this script :
tell application "Adobe InDesign CS4"
tell active document
set theFrames to count text frames
set theGroups to count text frames of group 1
display dialog "text frames = " & theFrames & return & "text frames in groups = " & theGroups
end tell
end tell
no worries — for this workflow we could just ungroup all the groups before converting to outlines :
tell application "Adobe InDesign CS4"
tell active document
repeat until (count of groups) = 0
ungroup every group
end repeat
tell every text frame
create outlines
end tell
end tell
end tell
the repeat loop ensures we get every group — that means groups within groups within… etc.
your homework for today is to come up with a solution which does not involve ungrouping the groups.
