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

formula lines position

Enthusiast ,
Feb 24, 2024 Feb 24, 2024

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
314
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 , 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

 

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

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.

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

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 

 

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

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)

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 ,
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=xf713...

 

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

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

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

 

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