How to outline a stroke in Illustrator CS2

I just want to know how to outline a stroke in Illustrator CS2 using applescript.

I can do it using System Events but I want to be able to do it without having that enabled.

Any help or advice would be appreciated even if the answer is “you can’t get there from here”. If I have to I guess I can draw my own box but I am looking for an easier way out.

Thanks,

Joe

It’s possible, you just need to do some preliminary work. Create an action set. Name it “Missing Script Commands”. Add a new action. Name it “Outline Stroke”. Record the Outline Stroke command from the Object>Path menu. Stop recording. Then you can use the following script to outline all stroked path items:

tell application "Adobe Illustrator"
	tell current document
		set convertPaths to every path item whose stroked is true
		repeat with thisPath in reverse of convertPaths
			if locked of thisPath then set locked of thisPath to false
			set selection to thisPath
			do script "Outline Stroke" from "Missing Script Commands"
		end repeat
	end tell
end tell

If you don’t want to effect locked paths then use:

tell application "Adobe Illustrator"
	tell current document
		set convertPaths to every path item whose stroked is true and locked is false
		set selection to convertPaths
		do script "Outline Stroke" from "Missing Script Commands"
	end tell
end tell

If you try to invoke the action via the script on locked items, you’ll get an error.

Joseph,

Thanks for the idea. I knew that making an action was an option but as I wanted to make the script as “stand-alone” as possible. Also it is just a simple path so I just created my own box where the path was.

Thanks, again for the input and help.

Joe