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

formula lines position

Engaged ,
Feb 24, 2024 Feb 24, 2024

Copy link to clipboard

Copied

I've been thinking about how to do this for a few days, what formula to use, I can't find a solution, my question is this, let's take an example: I have a 6000px document and I have 3 or more vertical lines, what could be the formula that positions them across the entire width of the document? I'll give an example if the document is 6000px divided by 3 it comes out 2000px then automatically the lines I created will move the first to 2000px the second to 4000px the third to 6000px, second example: if there are 4 lines, the first line is positioned at 1500px, the second at 3000px, the third at 4500px, the fourth at 6000px. I hope someone has a formula for this.

TOPICS
Actions and scripting

Views

161

Translate

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

Community Expert , Feb 24, 2024 Feb 24, 2024

You can take a look at this action, which should work for any quantity of vertical lines. You can convert it to batchPlay UXP code if you like, but there are of course going to be more efficient ways of scripting this than directly converting an action.

 

2024-02-24_22-54-28.png

 

https://www.dropbox.com/scl/fi/iwqvtzorf7qvopphzlq16/Distribute-Vertical-Line-Layers.atn?rlkey=xf713mm8qexysmno51fsrl2yn&dl=0

 

Votes

Translate

Translate
Adobe
Community Expert ,
Feb 24, 2024 Feb 24, 2024

Copy link to clipboard

Copied

Please upload a couple of sample PSD mockups or at least a screenshot of the main document window with the layers panel and properties panel visible with one of the line layers selected.

Votes

Translate

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
Engaged ,
Feb 24, 2024 Feb 24, 2024

Copy link to clipboard

Copied

This is what I would like to do

before

before.png

afret

after.png

 

link psd

https://www.mediafire.com/file/wr5s1dtflwmhjrs/psd.zip/file 

 

Votes

Translate

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

Copy link to clipboard

Copied

Is that sample file truly representative of the working files?

 

A flattened Background layer with vector line tool path layers?

 

That's it, no other layers, or groups or artboards etc?

 

If so, what is the expected start point for automation? Such as first manually selecting all line layers? Or are no layers selected or only the Background layer selected and not the lines?

 

P.S. How are the lines first created, do you have control over this? For example, could 5 lines be created if you need 3 (two extra temporary "helper" lines)

Votes

Translate

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

Copy link to clipboard

Copied

You can take a look at this action, which should work for any quantity of vertical lines. You can convert it to batchPlay UXP code if you like, but there are of course going to be more efficient ways of scripting this than directly converting an action.

 

2024-02-24_22-54-28.png

 

https://www.dropbox.com/scl/fi/iwqvtzorf7qvopphzlq16/Distribute-Vertical-Line-Layers.atn?rlkey=xf713...

 

Votes

Translate

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
Engaged ,
Feb 24, 2024 Feb 24, 2024

Copy link to clipboard

Copied

Stephen I'm not at home When I get back I'll try your method. you are always kind Thank you

Votes

Translate

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
Engaged ,
Feb 24, 2024 Feb 24, 2024

Copy link to clipboard

Copied

LATEST

Perfect, exactly what I was looking for,
Now that I see the action I ask myself a question
How come I never thought of that before

 

Sometimes the simple things are the best

 

you're you're always the best.

 

Votes

Translate

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