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

Apply Offset Path with specific values via script

Explorer ,
Feb 06, 2024 Feb 06, 2024

Copy link to clipboard

Copied

I am trying to make an action that has many steps. One of the steps is a Menu Item which is Effect > Path > Path Offset.  When I execute the the action, Path Offset window pops up and wait for me to enter values (Offset, Joins). I enter Offset: 0.1 mm, Joins: Round then I click Ok for the action to continue. I am looking for a way to set these values automatically so the action continues without me entering the same values every time.

 

I think this has two routes to solve. I should either add a script to implement a series of keystrokes right after the Path Offset menu item, in my case the key strokes in order should be "0.1 mm > tab > downarrow > enter". These key strokes will set Offset: 0.1 mm, Joins: Round and then click Ok.

 

Or, I should implement the Path Offset command with the desired values via calling Path Offset function in a script.

 

Offset.pngexpand image

Would you please help me with this. Is this something doable? Thank you in advance.

TOPICS
How-to , Scripting , Tools

Views

1.4K
Translate

Report

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

Guide , Feb 06, 2024 Feb 06, 2024

This snippet will apply an offset effect with the parameters you specified to a selected path. 

var string = '<LiveEffect name="Adobe Offset Path">' + 
'<Dict data="I jntp 0 R mlim 4 R ofst 0.283"/>' + 
'</LiveEffect>';
app.selection[0].applyEffect(string);

 

Votes

Translate
Adobe
Participant ,
Feb 06, 2024 Feb 06, 2024

Copy link to clipboard

Copied

just did a quick test. double check whether the dialog option is turned on or notScreenshot 2024-02-06 at 12.41.50 PM.pngexpand image

there will either be an empty box (its off) or the square next to the check mark is filled with a little icon

Votes

Translate

Report

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 ,
Feb 06, 2024 Feb 06, 2024

Copy link to clipboard

Copied

In Action menu, I can't see the options of the Offset Path. There is also no drop down menu for me to choose from. I am not sure what Dialog is. Is it the Offset Path window? I can only toggle Dialog for the whole action. I've toggled it on and off but nothing changed. Am I missing something here?

 

Actions.pngexpand image

Votes

Translate

Report

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
Participant ,
Feb 06, 2024 Feb 06, 2024

Copy link to clipboard

Copied

instead of using effect - path - offset. go to object - path - offset and see if that still does what you want

 

also from your screenshot. the square box next to the "offset outside path" down arrow and checkbox. click that to remove the dialog interactions

Votes

Translate

Report

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 ,
Feb 06, 2024 Feb 06, 2024

Copy link to clipboard

Copied

Unfortunately, object - path - offset doesn't work for me because it generates double lines. I also clicked the square box to remove the dialog interactions but it didn't work.

Votes

Translate

Report

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 ,
Feb 06, 2024 Feb 06, 2024

Copy link to clipboard

Copied

object - path - offset may work for me if I find a way to delete the original path after doing the offset.

Votes

Translate

Report

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
Participant ,
Feb 06, 2024 Feb 06, 2024

Copy link to clipboard

Copied

you can do this. when you do the object offset path. it will generate the new path below the current object. there is a command to select the object above/below. you can find this command via select then "next object above" and below, so you can create an action like this

Screenshot 2024-02-06 at 2.17.59 PM.pngexpand image

Votes

Translate

Report

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 ,
Feb 06, 2024 Feb 06, 2024

Copy link to clipboard

Copied

It is a good idea, but I usually work with multiple paths at the same time. Next Object Above works if I choose one path only.

Votes

Translate

Report

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 ,
Feb 06, 2024 Feb 06, 2024

Copy link to clipboard

Copied

I've just read that toggle dialog doesn't work with Insert Menu Items.

Votes

Translate

Report

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
Guide ,
Feb 06, 2024 Feb 06, 2024

Copy link to clipboard

Copied

This snippet will apply an offset effect with the parameters you specified to a selected path. 

var string = '<LiveEffect name="Adobe Offset Path">' + 
'<Dict data="I jntp 0 R mlim 4 R ofst 0.283"/>' + 
'</LiveEffect>';
app.selection[0].applyEffect(string);

 

Votes

Translate

Report

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 ,
Feb 06, 2024 Feb 06, 2024

Copy link to clipboard

Copied

That worked!! Thank you so much! Would you please explain the parameters inside in case I wanted to change the offset and joins.

Votes

Translate

Report

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 ,
Feb 06, 2024 Feb 06, 2024

Copy link to clipboard

Copied

Can you please add your further requests in the original thread?

Votes

Translate

Report

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 ,
Feb 06, 2024 Feb 06, 2024

Copy link to clipboard

Copied

I am not able to edit my thread. It is probably because I don't have enough points.

Votes

Translate

Report

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 ,
Feb 06, 2024 Feb 06, 2024

Copy link to clipboard

Copied

Not necessary to edit your thread. Just continue to ask further questions here:

 

Fast way or a script to offset only the outside path of a compound path

Votes

Translate

Report

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
Guide ,
Feb 06, 2024 Feb 06, 2024

Copy link to clipboard

Copied

LATEST

femkeblanco_0-1707257318566.pngexpand image

 

  • "jntp" is the join type of 0 (0 round, 1 bevel and 2 miter).
  • "mlim" is the miter limit of 4.
  • "ofst" is the offset of 0.283 points (or 0.1 mm); this can be a negative value.

Votes

Translate

Report

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 ,
Feb 06, 2024 Feb 06, 2024

Copy link to clipboard

Copied

I also may need to apply a negative offset, how can I apply that to the string?

Votes

Translate

Report

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 ,
Feb 06, 2024 Feb 06, 2024

Copy link to clipboard

Copied

In case this is related to your other request, I've added two alternative approaches there.

 

Fast way or a script to offset only the outside path of a compound path

Votes

Translate

Report

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