This is a script that among other things, creates a string of text from user input adding the words Cyan Magenta Yellow Black at the end. This is for marking plates with the respective colors. This script as far as I can tell, works fine in every file I've tried it on, except one which gives the above cryptic error. Hitting End in the dialog ends the script execution but Draw is then in a state that it can't be used and has to be closed. Doesn't crash, just doesn't update the screen.
Here's the relevant code that is causing the problem, it counts the words in the line of text and selects the relevant color name and applies the correct color to it:
Dim tr1 As TextRange, tr2 As TextRange, tr3 As TextRange, tr4 As TextRange Dim wordcount As Long wordcount = ActiveShape.Text.Story.Words.Count Set tr1 = TxtInfo.Text.Story.Words(wordcount - 3) Set tr2 = TxtInfo.Text.Story.Words(wordcount - 2) Set tr3 = TxtInfo.Text.Story.Words(wordcount - 1) Set tr4 = TxtInfo.Text.Story.Words(wordcount) tr1.Fill.UniformColor.CMYKAssign 100, 0, 0, 0 tr2.Fill.UniformColor.CMYKAssign 0, 100, 0, 0 tr3.Fill.UniformColor.CMYKAssign 0, 0, 100, 0 tr4.Fill.UniformColor.CMYKAssign 0, 0, 0, 100
It gets hung on the first color assign for the Cyan word, "tr1.Fill.UniformColor.CMYKAssign 100, 0, 0, 0" if I comment that out, it gets hung on the next line for Magenta, and I presume from there on, I didn't test that far.
Again, this works fine in other files, just not this particular file for some reason. If I copy out the relevant objects to a new file, then it works fine, but in it's original file, it doesn't work. Kind of an odd thing and there is a work around but if I could find out what in this particular file is causing this issue, that would be nice to eliminate the problem.
OK there was an embedded font that was not installed (Adobe font) that seems to be the cause of the issue. Funny thing is, I had thought it might be font related and converted all fonts to outlines first and it still crashes when in that file. Because that file has an embedded, not installed font, it causes that error. After I installed the font in the Adobe font app, the script works fine.
Not sure what the deal is there, but seems to be the issue.
What is the purpose of using the script?
It's a step & repeat script that takes the objects on the page and does some functions to them depending on user input, and one of those is to add a tag line that contains the name of the file and any user added information, and then adds the words "Cyan Magenta Yellow Black" at the end of the line and colors them the corresponding colors so the resulting plates will have the information and color added. It works fine and has worked fine for years until this one file that had an Adobe font used that was not actually installed on the system from the Adobe control panel. Not sure why that would cause an issue with adding a line of text to the file and coloring it, but there you go.
Is it for a non-postscript device?
The file is eventually sent to a RIP via PDF, but that has nothing to do with how the script runs, it doesn't care what or even if a printer is used. All it does is take user input, then do some functions to the objects on the page.
Sorry for the delayed response, I was away viewing the eclipse.
Thanks.