Skip to main content
Participant
December 13, 2008
Question

convert a selected shape in text path...

  • December 13, 2008
  • 2 replies
  • 637 views
Hi,
here is my code JS :
var docRef = activeDocument;
var lineRef = docRef.selection;

if ( activeDocument.selection.length > 0 ) {
var v = prompt("Saisissez votre texte...", "texte sur tracé");
var lineRef = activeDocument.pathItems[0];
var pathTextRef = activeDocument.textFrames.pathText(lineRef);
docRef.textFrames[0].contents = v;
docRef.textFrames[0].textRange.characterAttributes.size = 30;
docRef.textFrames[0].paragraphs[0].paragraphAttributes.justification = Justification.CENTER;

}
else {
alert( "Il faut sélectionner un tracé avant de lancer le script !" );
}
That's run But it's not the selected shape on my document who is converted in textpath
Thanks
JP
This topic has been closed for replies.

2 replies

Participant
December 13, 2008
Thanks a lot James
it's OK now :)
JETalmage
Inspiring
December 13, 2008
Jean, in your other thread on the same subject, you said you wanted to:

> Open a new document, select a circle on the page and run convert it.

There is no circle on the page of a new document. That's why Larry told you to create a new document, draw a circle and then use the script statements he provided you.

In the code that Larry provided, (and that you have used in the script in this thread), this line:

> var lineRef = activeDocument.pathItems[0];

is referencing the topmost (index 0) pathItem in the document.

to reference the topmost (index 0) pathItem of the current selection, change that line to:

> var lineRef = activeDocument.selection[0];

JET