I tried searching but to no avail. I have the following script that I would like to only change the few instances of “Adobe InDesign CS6” to other versions of InDesign such as “Adobe InDesign CC” and “Adobe InDesign CC 2014” and “Adobe InDesign CC 2015”. However, I do not own those versions of InDesign to compile and then save the script. My intent is to distribute this script to other users using these more recent versions of InDesign. Is there anything I can do to solve this?
Thanks,
-Jeff
global myStop
global blacksFound
on RGBCheck()
set myRGBCaught to "NO"
set RGBList to {}
set RGBCount to 0
tell application "Adobe InDesign CS6"
activate
set myDoc to active document
tell myDoc
repeat with docLinks from (count every link of myDoc) to 1 by -1
set myLink to link docLinks of myDoc
try
set mySpace to space of parent of myLink
if mySpace is "RGB" then
set myTestName to name of myLink
set myRGBFile to myTestName
set end of RGBList to myRGBFile & return
end if
end try
end repeat
set the RGBCount to count of items in RGBList
if RGBCount is equal to 1 then
tell application "SystemUIServer"
activate
set userResponseRGBCaught to display dialog "The following RGB placed image was found:" & return & return & RGBList & return & "Fix the image so it is saved as CMYK and replace accordingly." buttons {"OK, leave as-is", "Stop & Fix"} default button "Stop & Fix" with icon stop
if button returned of userResponseRGBCaught contains "Stop" then
set myStop to true
return
end if
end tell
else if RGBCount is greater than 1 then
tell application "SystemUIServer"
activate
set userResponseRGBCaught to display dialog "The following RGB placed images were found:" & return & return & RGBList & return & "Fix the image so it is saved as CMYK and replace accordingly." buttons {"OK, leave as-is", "Stop & Fix"} default button "Stop & Fix" with icon stop
if button returned of userResponseRGBCaught contains "Stop" then
set myStop to true
return
end if
end tell
end if
end tell
end tell
end RGBCheck
on myPasteboard()
tell application "Adobe InDesign CS6"
activate
tell document 1
repeat with i from 1 to (count of spreads)
tell spread i
try
set myPageItemsCount to count (every page item whose id of parent page is greater than 1)
set myAllItemsCount to count of (every page item)
set myPasteboardItems to myAllItemsCount - myPageItemsCount
end try
end tell
end repeat
if myPasteboardItems contains 1 then
tell application "SystemUIServer"
activate
set userResponse to display dialog "There was " & myPasteboardItems & " item found on the pasteboard. Make sure this item does not belong with this document. If it is not needed then it should be deleted." buttons {"OK, leave item on pasteboard", "Stop & Fix"} default button "Stop & Fix" with icon stop
if button returned of userResponse contains "Stop & Fix" then
set myStop to "true"
return
end if
end tell
end if
if myPasteboardItems is greater than or equal to 2 then
tell application "SystemUIServer"
activate
set userResponse to display dialog "There were " & myPasteboardItems & " items found on the pasteboard. Make sure these items do not belong with this document. If they are not needed then they should be deleted." buttons {"OK, leave items on pasteboard", "Stop & Fix"} default button "Stop & Fix" with icon stop
if button returned of userResponse contains "Stop & Fix" then
set myStop to "true"
end if
end tell
end if
end tell
end tell
end myPasteboard
on oversets()
set theCount to 0
tell application "Adobe InDesign CS6"
activate
tell active document
set myAllPageItems to all page items of page 1
set x to count of myAllPageItems
repeat with x from 1 to x
set y to item x of myAllPageItems
if class of y is text frame then
if overflows of y is true then
set theCount to theCount + 1
end if
end if
end repeat
repeat with x from 1 to x
set y to item x of myAllPageItems
if class of y is text frame then
if overflows of y is true and theCount is greater than or equal to 2 then
select y
tell application "SystemUIServer"
activate
display dialog "The selected text frame is overset." & return & return & "Also found " & theCount - 1 & " additional overset frame(s) besides this one." buttons {"Stop And Fix"} default button "Stop And Fix" with icon 0
end tell
set myStop to true
return
end if
if overflows of y is true and theCount is equal to 1 then
select y
tell application "SystemUIServer"
activate
display dialog "The selected text frame is overset." buttons {"Stop And Fix"} default button "Stop And Fix" with icon 0
end tell
set myStop to true
end if
end if
end repeat
end tell
end tell
end oversets
on colorSpace()
tell application "Adobe InDesign CS6"
set myDoc to document 1
activate
set myStop to false
set blacksFound to false
try
tell myDoc
try
set properties of every color of every item to {space:CMYK, model:process}
end try
end tell
end try
set allPageItems to object reference of all page items of myDoc
repeat with i from 1 to count of items in allPageItems
try
set theClass to class of item i of allPageItems as string
set theClass to theClass as string
on error
exit repeat
end try
if theClass is "rectangle" or theClass is "text field" or theClass is "text frame" or theClass is "polygon" or theClass contains "cpgn" or theClass contains "txtf" or theClass contains "crec" or theClass contains "govl" then
try
set y to fill color of item 1 of item i of allPageItems
set theTint to properties of y
set theProps to color value of y as string
set x to fill tint of item i of allPageItems as string
if theProps contains "0.00.00.0100.0" and x contains "-1.0" then
set blacksFound to true
end if
end try
end if
end repeat
if blacksFound is true then
tell application "SystemUIServer"
activate
set userResponse to display dialog " !!! W A R N I N G !!!" & return & return & "Found some black filled objects set to 100% Black." & return & return & "Objects set to 100% Black will overprint." & return & return & "This can result in a printing issue depending upon the stacking order and what objects these black areas overlap." & return & return & "It is best you change the Black swatch's tint to 99% or use a built-black, which will cause the black to knockout." & return & return & "Do you want this script to automatically convert all these objects to 99% Black?" & return & return buttons {"No", "Yes - Let Script Fix Blacks"} default button "Yes - Let Script Fix Blacks" with icon 2
if button returned of userResponse contains "No" then
return
end if
end tell
end if
set allPageItems to object reference of all page items of document 1
repeat with i from 1 to count of items in allPageItems
try
set theClass to class of item i of allPageItems as string
on error
exit repeat
end try
if theClass is "rectangle" or theClass is "text field" or theClass is "text frame" or theClass is "polygon" or theClass contains "cpgn" or theClass contains "txtf" or theClass contains "crec" or theClass contains "govl" then
try
set y to fill color of item 1 of item i of allPageItems
set theTint to properties of y
set theProps to color value of y as string
set x to fill tint of item i of allPageItems as string
if theProps contains "0.00.00.0100.0" and x contains "-1.0" then
set properties of item i of allPageItems to {fill color:swatch "Black" of document 1}
set fill tint of item i of allPageItems to 99
end if
end try
end if
end repeat
end tell
end colorSpace
--Script Begins Here
tell application "Adobe InDesign CS6"
set user interaction level of script preferences to interact with all
set myStop to false
set blacksFound to false
my colorSpace()
if myStop is true then
return
end if
my oversets()
if myStop is true then
return
end if
my RGBCheck()
if myStop is true then
return
end if
my myPasteboard()
end tell