Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

convert a selected shape in text path...

New Here ,
Dec 13, 2008 Dec 13, 2008
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
TOPICS
Scripting
589
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
LEGEND ,
Dec 13, 2008 Dec 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 13, 2008 Dec 13, 2008
LATEST
Thanks a lot James
it's OK now :)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines