Skip to main content
Known Participant
July 23, 2024
Answered

How to get align to path option value using extendscript?

  • July 23, 2024
  • 1 reply
  • 448 views

Hi,

I need to get align to path option value using extendscript.

 

Please help.

 

 

This topic has been closed for replies.
Correct answer m1b

There may be a hacky way to do it, such as something like this (via script):

(a) duplicate the textFrame

(b) set the duplicate's textFont, size, baselineShift and contents each to a pre-defined value, eg. contents might be set to "X" and textFont would be set to a known universally-available font.

(c) replace the textFrame's path with a straight horizontal line.

(d) convert the "X" textFrame to outlines

(e) compare the geometricBounds of the outlined X with the geometricBounds of a known (pre-recorded) bounds of X at the different "Align to path" options and decide which is in use.

(f) delete the duplicate textframe

 

I would put this in a function called getAlignToPathSetting. It would be a hack, same principle as the one I wrote here, but I think it would work.

- Mark

1 reply

m1b
Community Expert
Community Expert
July 23, 2024

Hi @Arunkumar25715058ufpl, as far as I can see, that property is not exposed to Extendscript API. Another option might be using an action to set it, and executing the action via ExtendScript. Do you think that would work in your case?

- Mark

Known Participant
July 23, 2024

Hi @m1b, there is no way to get the value using extendscript. only set the value using extendscript. is it right?

 

m1b
Community Expert
m1bCommunity ExpertCorrect answer
Community Expert
July 25, 2024

There may be a hacky way to do it, such as something like this (via script):

(a) duplicate the textFrame

(b) set the duplicate's textFont, size, baselineShift and contents each to a pre-defined value, eg. contents might be set to "X" and textFont would be set to a known universally-available font.

(c) replace the textFrame's path with a straight horizontal line.

(d) convert the "X" textFrame to outlines

(e) compare the geometricBounds of the outlined X with the geometricBounds of a known (pre-recorded) bounds of X at the different "Align to path" options and decide which is in use.

(f) delete the duplicate textframe

 

I would put this in a function called getAlignToPathSetting. It would be a hack, same principle as the one I wrote here, but I think it would work.

- Mark