C2 gradients when upgraded to C7

chris denesha cmd-list at 99main.com
Thu Sep 21 10:14:30 CDT 2006


Hello all,

I'm converting C2 documents to C7, and if there is a gradient at an angle the resulting EPS causes a typecheck Distiller error because of the decimal of the angle.  (OffendingCommand: mod, Stack: 90 157.17) the last number is the angle.

I thought a script could iterate through all elements checking for gradients (incidentally is there a super easy way to do this?) and fix the angle.  But I'm having trouble writing a good value back.  Here is some of what I'm trying to do, with a Page Fill as my gradient example.  Please note I'm not that good with properties and records..

-- beginning of script
if ((page border type of page 1 of document 1) as string) is in {"rectangle", "border"} then --check for gradient
         set myPageBorder to (page border of page 1 of document 1) -- returns border element 
         if (ink type of fill ink of myPageBorder) as string is "gradient ink" then
                 set myAngle to 0
                 set myAngleInt to 0
                 try -- may not have angles
                         set myAngle to (angle of gradient of fill ink of myPageBorder)
                         set myAngleInt to (angle of gradient of fill ink of myPageBorder) as integer
                 end try
                 try -- if this works, is already integer and can ignore gradient
                         set myAngleInt to myAngle as integer
                 on error -- fractional angle
                         set angle of gradient of fill ink of myPageBorder to myAngleInt -- works on object in memory
------ I thought I'd try and replace the border with my border element in memory, but I get an error
------ "Name is not Unique"
                         set (page border of page 1 of document 1) to myPageBorder 
------ So I decided to try and update the value directly, but it crashes C7 with error 15 (OS9)
                         set (angle of gradient of fill ink of page border of page 1 of document 1) to myAngleInt
------ After recording a test script, I used a different notation, this also crashes C7 with error 15
                         set properties of (gradient of fill ink of page border of page 1 of document 1) to {angle:myAngleInt}
------ This seems to be on the right track, but it doesn't want to accept just the angle property, message is 
------ "MultiAd Creator Pro got an error: Some required data was missing from the AppleEvent"
                         set properties of (page border of page 1 of document 1) to {fill ink:{gradient:{angle:myAngleInt}}}
------ With a simple gradient and recorded script I find that it wants all properties, i.e. position, colors, etc.
------ But that would mean extracting all properties and knowing how to put them all back, which is where I'm stuck
                 end try
         end if
end if
-- end of script




I'm looking for advice and pointers, I can write the code with a quick example.

Thanks in advance!



chris denesha 
Advertising & Telephone Systems Support, IT 
The Day Publishing Company 
(860)701-4485; OR (800)542-3354, X4485 
c.denesha at theday dot com - Work email
cmd-list at 99main dot com - List email 


More information about the Creator mailing list