I’m having a problem with creating a spot color in Indesgn CS2. My script works makes a spot color names it correctly, but when it tries to set my text fill color to the new spot color it crashes out Indesign. After a lot of trial an error I figured this to be the problem. I can open a file from recovery and try to set the text to the spot color and it crashes again. Any help on this?
Here is the script…
tell application "Finder"
set SaveFolder to choose folder name with prompt "Select Folder to Save Impo Files"
------------------------------------------------------
set product_number to text returned of (display dialog "Enter the Product Code Number" default answer "0000") as string
set product_1 to characters 1 thru 2 of product_number as text
set product_2 to characters 3 thru 4 of product_number as text
------------------------------------------------------
set inset_number to text returned of (display dialog "Enter the Inset Number" default answer "000") as string
set SpotColor to characters 2 thru 3 of inset_number as text
------------------------------------------------------
set win_size to button returned of (display dialog "Choose the Win Size" buttons {"Large", "Small", "Seal"} default button "Small")
if win_size is "Large" then
set win_size to "93"
end if
if win_size is "Small" then
set win_size to "92"
end if
if win_size is "Seal" then
set win_size to "94"
end if
------------------------------------------------------
set ImpoFolder to make new folder in SaveFolder with properties {name:inset_number}
------------------------------------------------------
end tell
----------------------Create Form File--------------------------------
tell application "Adobe InDesign CS2"
activate
set FormDoc to make document
tell document preferences of FormDoc
set page width to "8.5 in"
set page height to "11 in"
end tell
tell FormDoc
try
set LayerName to layer "Image layer" of FormDoc
on error
set LayerName to make layer with properties {visible:true, locked:false, name:inset_number}
delete layer 2
end try
set NewSpotColor to make color with properties {space:CMYK, color value:{0, 0, 0, 100}, name:SpotColor}
set properties of NewSpotColor to {model:spot}
delete color "C=100 M=0 Y=0 K=0"
delete color "C=0 M=0 Y=100 K=0"
delete color "C=0 M=100 Y=0 K=0"
delete color "C=15 M=100 Y=100 K=0"
delete color "C=75 M=5 Y=100 K=0"
delete color "C=100 M=90 Y=10 K=0"
set WinFormFrame to make text frame
set the geometric bounds of WinFormFrame to {"10.8438 in", "0 in", "11 in", "1.5 in"}
set contents of WinFormFrame to "WIN FORM #" & inset_number
set vertical justification of text frame preferences to bottom align
set justification of characters of WinFormFrame to left align
set applied font of characters of WinFormFrame to "Helvetica (TT)"
set font style of characters of WinFormFrame to "Bold"
set point size of characters of WinFormFrame to 12
set fill color of characters of WinFormFrame to NewSpotColor
set overprint fill of characters of WinFormFrame to true
set vertical justification of text frame preferences of WinFormFrame to bottom align
set save_name to "FORM " & inset_number as string
set dest_path to SaveFolder & inset_number & ":" as string
set FileName to dest_path & save_name
save to FileName
end tell
close active document
end tell