Adding Path Text. Adobe InDesign CS6
Advertisement
Advertisement
C HAPTER 5: Text and Type Adding Path Text 107
--Given a document "myDocument" containing a story that
--contains a table...
set myTable to table 1 of story 1 of myDocument tell myTable
--Apply alternating fills to the table.
set alternating fills to alternating rows set start row fill color to swatch "DGC1_446a" of myDocument set start row fill tint to 60 set end row fill color to swatch "DGC1_446b" of myDocument set end row fill tint to 50 end tell
The following script fragment shows how to process the selection when text or table cells are selected. In this example, the script displays an alert for each selection condition, but a real production script would then do something with the selected item(s). (For the complete script, see TableSelection.)
--Check to see if any documents are open.
if (count documents) is not equal to 0 then
--If the selection contains more than one item, the selection
--is not text selected with the Type tool.
set mySelection to selection if (count mySelection) is not equal to 0 then
--Evaluate the selection based on its type.
set myTextClasses to {insertion point, word, text style range, line, paragraph, text column, text, story} if class of item 1 of selection is in myTextClasses then
--The object is a text object; display the text object type.
--A practical script would do something with the selection,
--or pass the selection on to a function.
if class of parent of item 1 of mySelection is cell then display dialog ("The selection is inside a table cell") else display dialog ("The selection is not in a table") end if else if class of item 1 of selection is cell then display dialog ("The selection is a table cell") else if class of item 1 of selection is row then display dialog ("The selection is a table row") else if class of item 1 of selection is column then display dialog ("The selection is a table column") else if class of item 1 of selection is table then display dialog ("The selection is a table.") else display dialog ("The selection is not in a table") end if else display dialog ("Please select some text and try again.") end if else display dialog ("Nothing is selected. Please select some text and try again.") end if
Adding Path Text
You can add path text to any rectangle, oval, polygon, graphic line, or text frame. The following script fragment shows how to add path text to a page item (for the complete script, see PathText):
Download
Advertisement