SCRIPTING-selecting characters for manipulation
Grimm, Kenneth
kgrimm at sastandardtimes.com
Mon Apr 16 17:24:23 CDT 2007
Steve,
I'm stumped. I can select an entire text flow and manipulate it, but trying
to select individual characters in the text flow and manipulate just them is
proving to be difficult. What syntax do I need to accomplish this?
The purpose of the script is to place a tag line inside the document's page
area that will identify the plates as they come out our CTP unit.
Here's the relevant part of the script, please show me the obvious thing I'm
missing.
The script executes with no errors. I put in a display dialog "Got to here!"
with a return after to debug, and the dialog shows, so I know the script is
reading the lines, but nothing happens.
Help!
Ken Grimm
IT Systems Manager/Technical Specialist
San Angelo Standard-Times
34 W. Harris
San Angelo TX 76903
325-659-8357 Direct line
325-374-4238 Cell
325-659-8172 Fax
****HERE'S THE RELEVANT LINES OF THE SCRIPT
make new text flow at beginning of document 1 with properties {create
block with bounds:{top:6.0, left:150.0, bottom:20.0, right:750.0}}
set text selection of text flow 1 of document 1 to (docName & space &
colorSepsSpec)
--select the type
select every character of text flow 1 of document 1
--set type properties, characteristics in the text box
set size of text selection of text flow 1 of document 1 to 10.0
set alignment of text selection of text flow 1 of document 1 to flush
left
set font of text selection of text flow 1 of document 1 to "Geneva"
****THIS LINE WORKS, CAN BE USED TO CHANGE COLOR OF ENTIRE LINE
--start off with all text colorized "Black"
set color of text selection of text flow 1 of document 1 to
{color:"Black"}
****EVERYTHING ABOVE WORKS -- THIS IS ISSUE:
****THESE LINES SEEM TO HAVE NO EFFECT WHATSOEVER
if colorSepsSpecAnswer is "CMYK" then
set color of (characters -1 through -5) of text flow 1 of document 1
to {color:"Black"}
set color of (characters -6 through -11) of text flow 1 of document
1 to {color:"Yellow"}
Display dialog "Got to here!" <--- THIS LINE EXECUTES SUCCESSFULLY
Return
****TRIED THIS STYLE OF SYNTAX, ALSO NO RESULTS
select (characters 6 through -1) of text flow 1 of document 1
set color of text selection of text flow 1 of document 1 to
{color:"Magenta"}
****HOW DO I SELECT CHARACTERS SUCCESSFULLY AND CHANGE THEIR COLOR?
More information about the Creator
mailing list