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

guides in lines

Engaged ,
Mar 01, 2024 Mar 01, 2024

Copy link to clipboard

Copied

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-... 

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.

 

TOPICS
Actions and scripting

Views

224

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 , Mar 03, 2024 Mar 03, 2024

So it was a question, not a statement?

 

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

 

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

 

Votes

Translate

Translate
Adobe
Community Expert ,
Mar 02, 2024 Mar 02, 2024

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

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 ,
Mar 02, 2024 Mar 02, 2024

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.

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 ,
Mar 03, 2024 Mar 03, 2024

Copy link to clipboard

Copied

@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.

 

 

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 ,
Mar 03, 2024 Mar 03, 2024

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,

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 ,
Mar 03, 2024 Mar 03, 2024

Copy link to clipboard

Copied

There is a way to delete a guide via script.

 

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 ,
Mar 03, 2024 Mar 03, 2024

Copy link to clipboard

Copied

quote

There is a way to delete a guide via script.

 


By @Ciccillotto

 

 

That's a statement, however, I don't understand the context?

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 ,
Mar 03, 2024 Mar 03, 2024

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.

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 ,
Mar 03, 2024 Mar 03, 2024

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();

 

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 ,
Mar 03, 2024 Mar 03, 2024

Copy link to clipboard

Copied

Thank you Then I'll see if I can adapt it to my needs.

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 ,
Mar 05, 2024 Mar 05, 2024

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.

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 ,
Mar 05, 2024 Mar 05, 2024

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.

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 ,
Mar 05, 2024 Mar 05, 2024

Copy link to clipboard

Copied

LATEST

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?

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