Copy link to clipboard
Copied
guides in lines
I found this old discussion where guides are converted into lines,
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.
So it was a question, not a statement?
ES .remove() has become .delete() in UXP:
let the2ndGuide = app.activeDocument.guides[1];
the2ndGuide.delete();
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Stefano thank you for all the effort you make to help everyone, I don't ask for miracles, if there is a better solution. Keep in mind that I then have to convert Extendscript into a readable file for uxp,
Copy link to clipboard
Copied
There is a way to delete a guide via script.
Copy link to clipboard
Copied
There is a way to delete a guide via script.
By @Ciccillotto
That's a statement, however, I don't understand the context?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
So it was a question, not a statement?
ES .remove() has become .delete() in UXP:
let the2ndGuide = app.activeDocument.guides[1];
the2ndGuide.delete();
Copy link to clipboard
Copied
Thank you Then I'll see if I can adapt it to my needs.
Copy link to clipboard
Copied
Stefano I managed to make this string work,
I don't know if the deletion can be reversed,
Let me explain better:
when I use this string it deletes the guides starting from the first one I created,
It is possible to make the deletion begin from the last guide created.
Copy link to clipboard
Copied
Hard to comment without seeing the code. But if you used a forward loop, change it to a backwards loop... Or change the backwards loop to a forward loop.
Copy link to clipboard
Copied
Stefano there is no code, the code is the one you put above This: let the2ndGuide = app.activeDocument.guides[1]; the2ndGuide.delete(); as mentioned, delete the guides from the first one I created, I would like it to start from the last one created. do you have an idea how to do it?