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

select layer and fill selection

Participant ,
Jun 21, 2020 Jun 21, 2020

I have a text layer that I have used to work out the ext dimensions so I can put a background behind it. I have used script listener but I get a general Photoshop error. So I would like to move from the text layer to the background layer and fill the selected area

TOPICS
Actions and scripting
789
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

LEGEND , Jun 21, 2020 Jun 21, 2020
(col = new SolidColor()).rgb.hexValue = '000000', activeDocument.selection.fill(col, null, 70)
Translate
Adobe
LEGEND ,
Jun 21, 2020 Jun 21, 2020
aD.activeLayer = (aD = activeDocument).layers['DATA'].layers['Text Background']
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
Participant ,
Jun 21, 2020 Jun 21, 2020

apologies as you were submitting your reply I realised that I had got the original question wrong, so I used this part of your answer and the layer is selected

 

aD.activeLayer = (aD = activeDocument).layers['Text Background']
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
LEGEND ,
Jun 21, 2020 Jun 21, 2020

I don't understand your new questinon, explain it better by posting screenshot.

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
Participant ,
Jun 21, 2020 Jun 21, 2020

I have here a screenshot of where the scripts currently gets me and what I would like to achieve

where script currently gets mewhere script currently gets meideal result black fill 70%ideal result black fill 70%

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
LEGEND ,
Jun 21, 2020 Jun 21, 2020
(col = new SolidColor()).rgb.hexValue = '000000', activeDocument.selection.fill(col, null, 70)
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
Participant ,
Jun 21, 2020 Jun 21, 2020
LATEST

Many thanks a great answer as always. I just now need to deselect the selection.

 

which I have done with

 

	activeDocument.selection.deselect();
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