nellbern,
I added a few things that I see when dealing with InDesign files from customers.
I made the script work with folders and files that are dropped.
I added a longer user info dialog for those who double click the icon.
I added other examples of things I need to fix from time to time (there are still colors like Custom Color, Match Blue, and the like, that people add without thinking of the final product).
I added a color code (by changing the label color) for those files that were not re-saved, because I have to check to see why the color was not changed, note the other colors above that people add.
And, I added a “Done!” dialog, because I am impatient and want to know when it finishes without watching it.
There is probably a quicker way.
-- instruct if double clicked
on run
tell application "Finder"
display dialog "This is a Droplet. Please drop a Folder or Files onto the Droplet icon to convert InDesign files with PANTONE 2655 to Black." & return & return & " (Tints will stay tints of Black)."
end tell
end run
on open source_folder
try
tell application "Finder"
set this_item to files of folder source_folder
end tell
on error
set this_item to source_folder
end try
repeat with this_item in this_item
set SaveCode to 0 -- control for changing label color. if no changes this number will not change.
set doc_kind to kind of (info for this_item as alias)
if doc_kind contains "InDesign" then
tell application "Adobe InDesign CS3"
open this_item
tell active document
-->If Spot Colors Starting with PANTONE 2655 (EX. includes any form of it: CV, C, U, Copy, etc) is found, convert to K
try
set theListOfColors to (every swatch whose model is spot and name begins with "PANTONE 2655")
set properties of item 1 of theListOfColors to {model:process, space:CMYK, color value:{0, 0, 0, 100}}
set SaveCode to 1
end try
-- Some customers shorten the name, deactivate if unwanted
-->If Spot Color Starts with PMS2655 (EX. same as above and PMS2655-1, etc) is found, convert to K
try
set theListOfColors to (every swatch whose model is spot and name begins with "PMS2655")
set properties of item 1 of theListOfColors to {model:process, space:CMYK, color value:{0, 0, 0, 100}}
set SaveCode to 1
end try
-- Some customers screen mix colors, not understanding spots and figure you will fixed any problems, deactivate if unwanted
-->If Screen Mix Color Starts with PANTONE 2655 is found, convert to K
try
set theListOfColors to (every swatch whose model is process and name begins with "PANTONE 2655")
set properties of item 1 of theListOfColors to {model:process, space:CMYK, color value:{0, 0, 0, 100}}
set SaveCode to 1
end try
if SaveCode = 0 then -- if document is unchanged, close and no save.
close saving no
--If you want a quick visual of which files were not changed, deactivate if unwanted
tell application "Finder"
set label index of this_item to 2
end tell
else
close saving yes -- if SaveCode was changed from 0 to 1, close AND save
end if
end tell
end tell
end if
end repeat
tell me to activate --activate the script to bring it to the front
display dialog "Done!"
end open
Hope that helps.
Brian