Insert image in Photoshop

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

phoenix
Posts: 7
Joined: Fri Apr 05, 2019 8:15 am

Re: Insert image in Photoshop

Post by phoenix »

Sorry for the late reply, but I ran out of time. So I did the editing by hand so I could finish on time.

But now that I have some time again, I will deal with it again at the beginning of next year.

Unfortunately, your revised script didn't work for my purposes, because I don't want to create a new document, but want to apply the script to an existing document.

In addition, the script always shifts the graphics by the same value. I need to be able to determine the Y position of each graphic individually. That's why I used an array in my script.

Nevertheless, thanks again for your help. ;) Unfortunately your script style is very difficult for me as a script beginner to understand.
User avatar
Kukurykus
Posts: 528
Joined: Mon Jul 25, 2016 12:36 pm

Re: Insert image in Photoshop

Post by Kukurykus »

Make sure your document has 72 dpi, then replace:

Code: Select all

dcmnt = documents.add(500, 500, 72)
to:

Code: Select all

y = [20, 50, 180, 210], dcmnt = activeDocument
and:

Code: Select all

dcmnt.selection.select([[30, x1 += 20], [51, x1], [51, x2 += 20], [30, x2]])
to:

Code: Select all

shft = y.shift(), dcmnt.selection.select([[shft, x1 += 20], [shft + 21, x1], [shft + 21, x2 += 20], [shft, x2]])