Skip to main content
Inspiring
March 1, 2024
Answered

guides in lines

  • March 1, 2024
  • 1 reply
  • 1033 views

guides in lines

I found this old discussion where guides are converted into lines,

https://community.adobe.com/t5/photoshop-ecosystem-discussions/transforms-guides-into-lines-2017/td-p/9253776 

I would like to do the same thing in uxp
my current problem is this:
tell the program to find the guides in succession,
because if I do it the coordinate values are stored,
so if I use my action on another document
with guides positioned differently when I start the action
this gives me the same values as the previous document.

do you have any ideas.

 

This topic has been closed for replies.
Correct answer Stephen Marsh

The context is this with uxp I find the coordinate of the first guide and transform it into a line, then the second guide is not seen because the first guide is still present, so if I can eliminate the guide before it creates the second line my method would work.


So it was a question, not a statement?

 

ES .remove() has become .delete() in UXP:

 

let the2ndGuide = app.activeDocument.guides[1];
the2ndGuide.delete();

 

1 reply

Stephen Marsh
Community Expert
Community Expert
March 3, 2024

That script is a mixture of legacy JS, DOM and AM code.

 

Does the new UXP DOM have similar guide properties and methods?

 

Can batchPlay be used similarly to create a function using JS, DOM and batchPlay?

 

Such "simple" things need to be worked out in UXP, I hope that Adobe can help the old user base transition.

 

EDIT: A quick read shows that guide/guides don't appear to have changed too much:

 

UXP:

https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/guide/

https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/guides/

 

ES:

https://theiviaxx.github.io/photoshop-docs/Photoshop/Guide.html

https://theiviaxx.github.io/photoshop-docs/Photoshop/Guides.html

Inspiring
March 3, 2024

Stefano thanks for your input, I already knew this page and I applied part of the uxp code to obtain the coordinates. my problem is this; I can't scroll through all the lines, it only changes the first guide, I've been trying to find a solution for 2 days, but I can't find any solutions.

Stephen Marsh
Community Expert
Community Expert
March 3, 2024

@Ciccillotto 

 

You are further down the path of learning UXP than I am. I take a lot for granted when it comes to all the hard work that came before me in legacy ExtendScript. Without a formal education or background in JS or coding, I just hack away and tinker as a hobby.