-
1. Re: creating outlines from text using javascript in Illustrator CS5
Muppet Mark Feb 18, 2012 7:19 AM (in response to duhwellhuh)There is a built-in command for this in all the scripting languages AI supports its a straight forward method of text.createOutlines()
-
2. Re: creating outlines from text using javascript in Illustrator CS5
duhwellhuh Feb 18, 2012 7:32 AM (in response to Muppet Mark)Thanks for the response. Something straightforward is what I was looking for,but will that affect all text that even though it wasn't created with javascript like TextFrame.add or similar? And if so, could you provide a little sampling of this code if you have the time? That would be a huge help!
thanks
-
3. Re: creating outlines from text using javascript in Illustrator CS5
Muppet Mark Feb 18, 2012 7:44 AM (in response to duhwellhuh)The something like this may work… Should outline text at all depths wether it be locked or not visible… Sure it was posted here before… JS so you can try it on either platform…
#target illustrator function outlineDocText( ) { if ( app.documents.length == 0 ) return; var docRef = app.activeDocument; recurseLayers( docRef.layers ); }; outlineDocText(); function recurseLayers( objArray ) { for ( var i = 0; i < objArray.length; i++ ) { // Record previous value with conditional change var l = objArray[i].locked; if ( l ) objArray[i].locked = false; // Record previous value with conditional change var v = objArray[i].visible; if ( !v ) objArray[i].visible = true; outlineText( objArray[i].textFrames ); // Recurse the contained layer collection if ( objArray[i].layers.length > 0 ) { recurseLayers( objArray[i].layers ) } // Recurse the contained group collection if ( objArray[i].groupItems.length > 0 ) { recurseGroups( objArray[i].groupItems ) } // Return to previous values objArray[i].locked = l; objArray[i].visible = v; } }; function recurseGroups( objArray ) { for ( var i = 0; i < objArray.length; i++ ) { // Record previous value with conditional change var l = objArray[i].locked; if ( l ) objArray[i].locked = false; // Record previous value with conditional change var h = objArray[i].hidden; if ( h ) objArray[i].hidden = false; outlineText( objArray[i].textFrames ); // Recurse the contained group collection if ( objArray[i].groupItems.length > 0 ) { recurseGroups( objArray[i].groupItems ) } // Return to previous values objArray[i].locked = l; objArray[i].hidden = h; } }; function outlineText( objArray ) { // Reverse this loop as it brakes the indexing for ( var i = objArray.length-1; i >= 0; i-- ) { // Record previous value with conditional change var l = objArray[i].locked; if ( l ) objArray[i].locked = false; // Record previous value with conditional change var h = objArray[i].hidden; if ( h ) objArray[i].hidden = false; var g = objArray[i].createOutline( ); // Return new group to previous Text Frame values g.locked = l; g.hidden = h; } }; -
4. Re: creating outlines from text using javascript in Illustrator CS5
duhwellhuh Feb 18, 2012 7:54 AM (in response to Muppet Mark)You are the Jedi Master of Illustrator Scripting! thanks for this script. This will work and I just found another link where you helped someone else. You are truly amazing!! Thanks
-
5. Re: creating outlines from text using javascript in Illustrator CS5
Muppet Mark Feb 18, 2012 8:33 AM (in response to duhwellhuh)Hum… I've seen muppets in space and I don't recall any of them having the force…
-
6. Re: creating outlines from text using javascript in Illustrator CS5
duhwellhuh Feb 18, 2012 9:06 AM (in response to Muppet Mark)...well now one of them does. Thanks again for the help.
-
7. Re: creating outlines from text using javascript in Illustrator CS5
williambub Aug 8, 2013 6:57 AM (in response to Muppet Mark)Hey Muppet Mark! I was hoping you could help me further this bit of scripting. I'd like to save a copy of the illustrator file and then create and save an outlined version, adding OUTLINE to the end of the file name. Is this doable? I'm just not sure where to add in the AIOptions and such... Could you help me?

