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

Script to access Pathfinder Tool

Explorer ,
Jul 12, 2020 Jul 12, 2020

Hi All,

I have been looking all over to see if I could find anything on jsx script to access the pathfinder tool. I have a script that is adding text in a font that is "single line", really it is a closed compoundpath after outlined. I can use the outline option from the pathfinder tool which deletes the redudant points, but have not found a way to do so from a script. Trying to avoid having the user do this step manually.

 

I have already tried the Live Pathfinder Outline, but this is exectuing the menu command which has a different behavior than the tool. I do note understand why that is but unimportant in this context.

 

TOPICS
Scripting
1.5K
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 12, 2020 Jul 12, 2020

I see, try recording an Action to apply the path finder, then have the script play the action.

Translate
Adobe
Community Expert ,
Jul 12, 2020 Jul 12, 2020

Live Pahtfinder Outline applies an Effect, you have to Expand Appearance to get the same results as the pathfinder tool.

app.executeMenuCommand('expandStyle');

 

by the way, the number of points remained the same when I used the tool manually in the test I made.

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 12, 2020 Jul 12, 2020

See thread delete-remove-duplicate-paths  I am following the steps from the second to last comment from the bottom, from Lizzzzahhh.

If I use the Pathfinder palette it works. It is an outlined text that is closed shape, but it is a single line font so the paths and point are directly on top of eachother. After the steps mentioned above, the duplicates are removed.

 

If I use the menu Effect > Pathfinder > Outline and then expand appearance it does not work. I am still left with duplicate 1-to-1 paths and points. If you draw a rectangle and then copy it in front, then select both and use the palette to do Outline does it not removed the second path? I tried this as well and I was left with one rectangle path.

Screen Shot 2020-07-12 at 8.56.16 PM.pngexpand image

 

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 12, 2020 Jul 12, 2020

I see, try recording an Action to apply the path finder, then have the script play the action.

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 13, 2020 Jul 13, 2020

That did the trick, thanks. Was able to use another post by Silly-V to write the action from a string to a file, load, run, and unload.

Where do you all find some of this stuff? I swear its like the documentation has a secret menu. Like the executeMenuCommand I found a couple of years ago, but still have never seen it in any of the official documentation. Unless I am not looking hard enough.

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 14, 2020 Jul 14, 2020
LATEST

I hear you, executeMenuCommand and writing/updating Actions is not in the official documentation. Those are contributions from the great members of this forum.

 

hmm...I should put together an unofficial Scripting Reference.

 

....don't hold your breath though 🙂

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