Expanding type in Adobe Illustrator CS6 problem

A few years ago I wrote an ApplescriptObjC app that would create some text in an Illustrator layer and then expand it.

I’m in the process of updating said app, but the code for expanding the type doesn’t work properly anymore. It still kind of works, but the type comes out all distorted. When pasting the code in Applescript Editor, the text expands just fine. Even pasting the code into a new ApplescriptObjC project gives me perfectly fine results.

Are there any known issues with text expansion in CS6? The app is fairly complex and goes through many steps. I’d hate having to disable every step to see what is causing the trouble.

tell application "Adobe Illustrator"
            tell current document
                set myLayer to make new layer at end
                set name of myLayer to "Text"
                make new text frame in myLayer with properties {name:"PointText", contents:"Text to be expanded"}
                convert to paths every text frame
            end tell
        end tell

I’m not sure what your problem is. Your code works the same here in an ASObjC project as from ASE.

It sounds like the problem is something happening before it gets to that code…

Oh absolutely, but where. All the code leading up to this problem area is so intricate. Every step relies on the previous one, it’s pretty much impossible to comment out any portions or isolate code. I thought it was worth a shot posting the question here in the vain hope someone might recognise the problem.

Rather than trying to find what exactly is causing the problem, I may just work my way around it with some GUI scripting.

Only the person with the code can answer that :frowning:

Have you checked in Console for any error messages? Other than that, you need lots of logging (and patience, I suspect).

Well, the problem is that the text does expand with my app. No errors in the console, and the logs tell me everything is going swimmingly. I copied and pasted the code from a previous incarnation of the app where it didn’t cause any problems.
But in the new app, the points of the resulting bezier curves after text expansion are all just a bit off, making the text look like a CAPTCHA. My current thinking is that it is an Illustrator CS6 issue.

In the end, using GUI scripting to trigger the same function did the trick.

tell application "Adobe Illustrator"
            activate
        end tell
        tell application "System Events"
            tell process "Adobe Illustrator"
                tell menu bar 1
                    tell menu bar item "Type"
                        tell menu "Type"
                            click menu item "Create Outlines"
                        end tell
                    end tell
                end tell
            end tell
        end tell

I had to use some GUI scripting for Ai since it still is missing certain commands and other flaky things occur for some things. Can’t convert document to CMYK still? Really? Really? :confused: