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: Stephan Peterson <email@hidden>
- Date: Sun, 20 May 2007 10:51:19 -0500
Simon,
I started out down that path, but my concern is that the number of
character could be variable depending on the data in the file. I
didn't want to risk not reading enough data. The particular files I'm
reading for this workflow are AI files with placed TIFFs. The huge
majority of the size of the job is in the TIFFs, not the AI file. On
500-600k files the read is pretty quick. I wish I could do a read
until "some string" was reached, but that doesn't appear possible.
Based on my research and testing the "read until" will only stop at a
certain character, not a string. :-(
Thanks again for your help.
Stephan
On May 19, 2007, at 3:41 AM, Simon Topliss wrote:
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 (applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
40goofybastard.com
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
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