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

How to get align to path option value using extendscript?

Explorer ,
Jul 23, 2024 Jul 23, 2024

Hi,

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

Arunkumar25715058ufpl_0-1721739535534.pngexpand image

 

Please help.

 

 

TOPICS
How-to , Scripting
348
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

correct answers 1 Correct answer

Community Expert , Jul 24, 2024 Jul 24, 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-re

...
Translate
Adobe
Community Expert ,
Jul 23, 2024 Jul 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

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
Explorer ,
Jul 23, 2024 Jul 23, 2024

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

 

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
Community Expert ,
Jul 24, 2024 Jul 24, 2024
LATEST

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

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