Skip to main content
Known Participant
February 11, 2023
Question

Text frame onto path, automation

  • February 11, 2023
  • 2 replies
  • 997 views

Hello group,

 

I will write what what I would like to get. I have what is on picture A, and I would like to get what is on picture B. Kind of script, idea or anything what could help. And I want pay.

 

Some more details - I have more such text frames in my document and I would like to move them onto paths. It is a map and I don't want horizonal text - topo names, I would like to move them on paths, prepared before. It could be for example kind od "drag and drop" idea. I grab them and drop onto paths. Or perhaps somebody has got any better ideas. Semi - automation is OK.

 

I attach illustrations. If there is ai sample file needed, I will prepare that.

 

Thank you for any help.

This topic has been closed for replies.

2 replies

renél80416020
Inspiring
February 12, 2023

Bonjour,

Au plus simple, pour peut-être pour contenter Beff ?

Sélectionnez le texte et le tracé.

 

 

 

 

// JavaScript Document
if (app.documents.length > 0) {
  var docRef = activeDocument;
  var selectedItems, nbItems, saisieText, pathTextRef;
      selectedItems = selection;
      nbItems = selectedItems.length;
      if (nbItems > 1) {
        for (var i = 0; i < nbItems; i++) {
          if (selectedItems[i].typename == "TextFrame") {
            saisieText = selectedItems[i].contents;
            selectedItems.splice(i,1);
            break;
            }
        }
      if (selectedItems[0].typename == "PathItem" && saisieText != undefined) {
        pathTextRef = docRef.textFrames.pathText(selectedItems[0]);
        pathTextRef.contents = saisieText;
      }
     }
}

 

 

 

 

René

BeffAuthor
Known Participant
February 12, 2023

Bonjour,

 

Nice, Rene 🙂

But I see some are upside down on the paths after applying script. So first all paths should be made in one direction.

The other thing it would be OK to do them at once. All of them, but for sure there would be conflicts (when one text frame comes through two paths and so on). So these conflicts I could do manually afterwards. There shouldn't be much of such conflicts per map.

 

Can we talk on priv ?

 

Cordialement,

renél80416020
Inspiring
February 12, 2023

Oui tu peux, mais donne des exemples (CS6)

ainsi que les détails.

Cordialement René

Toujours la même adresse mail.

m1b
Community Expert
Community Expert
February 11, 2023

Hi @Beff,  unless you have special requirements beyond what you've shown here, I think running a script would take about the same amount of time as copying the text, clicking on the path (to convert to path text) and pasting and deleting the first path.

 

That said, a script or action should easily cope with the task. Someone here will be able to write it, or I will have a go when I get some time. There may be challenges relating to the orientation of the text, but I doubt it will be too difficult. - Mark