I’m working on converting my Quark 6.5 text formatting scripts to InDesign CS2 on OSX 10.3.9.
Here are my first two questions:
My Quark scripts operate only within text boxes that the user has clicked on:
tell application "QuarkXPress"
activate
tell document 1 of application "QuarkXPress"
tell story 1 of current box --THIS LINE!
set first indent to "p9"--All my glorious text formatting like this would go here
end tell
end tell
end tell
Is there an equivalent of “current box” in InDesign?
In Quark, If I’d want to change formatting of words based on it’s font and whether it was bold and/or Italic. For this I’d write:
--checks that the font is "Times" and is bold and changes it to "B Times Bold" font
set (font of every text style range whose font is "Times" and style is bold) to "B Times Bold"
InDesign doesn’t seem to handle fonts the same way Quark does. I’ve been trying something like this with a character style, but it’s not working:
tell application "Adobe InDesign CS2"
activate
tell document 1
tell parent story of text frame 1
try
set (applied character style of every text style range whose applied font is "Times" and text style is "Bold") to "Company Names"
end try
end tell
end tell
end tell
The name of the font is “B Times Bold” but that doesn’t work. InDesign splits it into family:“Times” style:“Bold”
Any help would be appreciated.