vertical gradients in InDesign table?
vertical gradients in InDesign table?
- Subject: vertical gradients in InDesign table?
- From: "Hedrington, Peter" <email@hidden>
- Date: Mon, 7 Jul 2003 17:13:10 -0400
I am trying to script adding a vertical gradient blend for each brand name
in InDesign tables.
Each table can run as long as 40 pages and there can be from two to ten
brand names per page.
I have a script which will work on the first page but the cells (rows) see
their offset from the beginning of the chart not the page they are on. As
the gradients starting point is relative to the page it is on, starting on
the second page I get what appears to be a solid fill which is really the
very bottom of a gradient.
Here is the script. This is being done in OS 9.2.2, InDesign 2.0.2.
-- SV Black indicates a row containing a brand name
tell application "InDesign 2.0.2"
tell active document
set theFrame to object reference of selection
set theStory to parent story of theFrame
set theTable to table 1 of theStory
set rowCount to count of rows of theTable
set brandRows to {}
repeat with i from 1 to rowCount
set rowColor to name of fill color of row i of theTable
if rowColor = "SV Black" then
set brandRows to (brandRows & i)
end if
end repeat
set theGrad to "SV Gradient 1"
set brandRows to (brandRows & (rowCount + 1))
set brandCount to count of items of brandRows
repeat with i from 1 to (brandCount - 1)
set rangeStart to ((item i of brandRows) + 1)
set rangeEnd to ((item (i + 1) of brandRows) - 1)
set theStarts to height of rows 1 thru rangeStart of
theTable
set fillStart to 0
set fillLength to 0
set startsCount to count of items in theStarts
repeat with i from 1 to startsCount
set fillStart to (fillStart + (item i of theStarts))
end repeat
set theHeights to height of rows rangeStart thru rangeEnd of
theTable
set heightsCount to count of items in theHeights
repeat with i from 1 to heightsCount
set fillLength to (fillLength + (item i of
theHeights))
end repeat
set fillLength to (fillLength * 12)
set fill color of rows rangeStart thru rangeEnd of theTable
to swatch theGrad
set properties of rows rangeStart thru rangeEnd of theTable
to {gradient fill start:{18, fillStart}, gradient fill angle:-90, gradient
fill length:fillLength}
if theGrad = "SV Gradient 1" then
set theGrad to "SV Gradient 2"
else
set theGrad to "SV Gradient 1"
end if
end repeat
end tell
end tell
Am I using the wrong approach or can I work in a page identifier somehow?
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.