Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Searching for RGB images in a Quark doc



Somebody posted this.... wish I could give them the credit they deserve... But it might help you out. I have some incarnation of this running on our art folders so that rgb images cant get put in this folder...

Mark


on adding folder items to this_folder after receiving these_items
repeat with i from 1 to number of items in these_items

set this_item to item i of these_items
tell application "Finder"
set theFileName to the name of this_item
end tell

tell application "Image Events"
launch
set this_image to open this_item
set theCSpace to the color space of this_image
copy the resolution of this_image to {xres, yres}
close this_image
end tell

set theCSpaceString to theCSpace as string

if theCSpaceString does not contain "CMYK" and xres is less than 250 then
my alertNumpty(theFileName, "both")
end if

if theCSpaceString does not contain "CMYK" and xres is greater than 250 then
my alertNumpty(theFileName, "rgb")
end if

if xres is less than 250 and theCSpaceString contains "CMYK" then
my alertNumpty(theFileName, "res")
end if


set this_item to ""
set this_image to ""
set theCSpace to ""

end repeat

end adding folder items to


on alertNumpty(theFileName, theReason)

if theReason is equal to "rgb" then
tell application "Finder"
--activate
beep
display dialog "The image " & theFileName & " has been saved as
RGB, no RGB images should be saved in this folder."
end tell

else if theReason is equal to "res" then
tell application "Finder"
--activate
beep
display dialog "The resolution of the image, " & theFileName & "
is less than 250 pixels/inch. Images should be saved at 300 pixels/ inch."
end tell

else if theReason is equal to "both" then
tell application "Finder"
--activate
beep
display dialog "The image " & theFileName & " has been saved as
RGB and it the resolution is less than 250 pixels/inch. Sort it out!!"
end tell
end if
end alertNumpty
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden


This email sent to email@hidden
References: 
 >Re: Searching for RGB images in a Quark doc (From: email@hidden)
 >Re: Searching for RGB images in a Quark doc (From: Peter Waibel <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.