Re: Determine whether spot color is RGB or CMYK in Illustrator CS2
Re: Determine whether spot color is RGB or CMYK in Illustrator CS2
- Subject: Re: Determine whether spot color is RGB or CMYK in Illustrator CS2
- From: Simon Topliss <email@hidden>
- Date: Sat, 19 May 2007 09:41:40 +0100
On 18 May 2007, at 21:59, Stephan Peterson wrote:
After much banging of my head against the wall I finally have a
solution. Unfortunately, it doesn't involve the scripting of
Illustrator due to an apparent bug.
[snip]
On the advice of a co-worker I explored just opening the file in a
text editor like Text Wrangler and seeing if by chance I could from
any text in the document if RGB sptos were present. BINGO! In the
comments/header at the beginning there's a "%%RGB Custom Color:"
entry that's present if RGB spots exist in the document. This lead
me to the following code for determining and RGB spot colors presence:
set theFile to "path:to:the:file.ai"
-----
set theText to read file theFile
-----
if theText contains "%%RGBCustomColor:" then
set containsRGB to true
else
set containsRGB to false
end if
Good work, Stephan!
You might want to change your 'read file' line to...
set theText to read file theFile for 2000
The info you need is only in the header of the AI file. So, just read
the first 2000 characters. This will make reading large files a lot
quicker.
Adjust the '2000' if required.
Simon
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden