Hang in there, this is a weird one.
I’m creating a plugin that generates bus timetables. This includes generating a “timepoint” for each bus stop, which is a colorful symbol that helps the user find the bus stop on the map. Here’s my current example, the top row of colorful circles are the timepoints:
This is a simplified version of how each timepoint is created in my plugin:
- Create an oval in the document and style it
- Create a textframe with a letter, and convert to outlines
- Align and group the oval and letter
- Select and cut the newly-formed group
- Select the cell’s first insertion point and paste the group
And this works! It works well! But it’s slow and goofy. Here’s what it looks like:
You can see the timepoint created at the document origin and then pasted in each cell. Each timepoint is an anchored object and acts like a character:
Now the problem is this approach is pretty slow, and I figure there must be a more direct way to set the cell’s contents instead of cutting and pasting. Well how about I just set the cell.contents
to the group, then?
This approach just sets the cell types to graphic cells. Converting them to text cells results in the intended behavior, but the stretched timepoint remains. I’ve also tried converting the cell to a text cell before setting the contents, but same thing.
So this all boils down to: how can I programmatically insert an anchored object into a text cell?