What's new

Scripting Photoshop Script to Paste Multiple Items


Chris Mattock

Member
Messages
5
Likes
1
Hi guys, so I am very new (in fact not even started) with scripts in PS, but here is my problem.

I have a huge JPG chart of the East Coast of Zanzibar.
I have 500 GPS coordinates of my sailing trip.
I can convert those 500 points into xy coordinates for the chart.

What I would then like to do is paste an object (some kind a X perhaps) on each point, is there a way of doing this automatically?

Even better would be if I could automatically link the points together with a line of a particular style.

EVEN better would be if I could have text next to each of these points stating the date and time (information which I have).

So is any of this possible? Or do I have a weekend of manually entering 500 points ahead of me?

Any help greatly appreciated! Thanks!
 

Paul MR

The Script Master
Messages
382
Likes
206
Its posible to create a path with the xy coordinates then stroke the path.
The text could also be added.
The big question is how do you have this information? is it in a speadsheet? if so it could be saved to a CSV file and that used to populate your jpg.
Also the size of the jpg would be required and the size of font to be used.
 

Chris Mattock

Member
Messages
5
Likes
1
THANKS!

The data is in a spreadsheet, however I can easily copy it into a script if need be, or, as you suggest, have it in a CSV file.

Unfortunately I have only ever used VB and never scripted anything in photoshop, if I just knew a simple way of pasting the same item in ten locations I'd be happy as a start... i.e.

Copy Item
Paste Item (1000,2100)
Paste Item (1000,2200)
Paste Item (1000,2300)
Paste Item (1050,2350)
Paste Item (1100,2400)
Paste Item (1100,2500)
Paste Item (1200,2500)
Paste Item (1300,2500)
Paste Item (1400,2500)
Paste Item (1500,2500)
Paste Item (1600,2700)
Paste Item (1700,2800)

End

If I knew the context I could easily get excel to format the data in such a way I could just paste it into a notepad file as the script... sorry, total noob here.
 
Last edited:

peta62

Guru
Messages
727
Likes
190
Hello,
would not it be easier to use some mapping device provided by GPS vendor ? I have good programs from Garmin. Then yo can just take the line and paste into your map jpg. Just an idea.
Best regards,
Pete
.
 

Chris Mattock

Member
Messages
5
Likes
1
Thanks, sadly all I have is a spreadsheet of coordinates, not the device or an output file itself.

I'm actually pretty amazed that it seems so difficult to just have a script that pastes an object at a set of coordinates. :(
 

Paul MR

The Script Master
Messages
382
Likes
206
Ok here is an example:
Create a text file with your coordinates as:-
1000,2100
1000,2200
1000,2300
1050,2350
1100,2400
1100,2500
1200,2500
1300,2500
1400,2500
1500,2500
1600,2700
1700,2800
Download the zip file, unzip and place the script in the relevant folder.
PC:- C:/Program Files/Adobe/Adobe Photoshop CS#/Presets/Scripts/
Mac:- [hard drive]/Applications/Adobe Photoshop CS#/Presets/Scripts/


Restart Photoshop if it was open.
open your map
Run the script:
File - Scripts - "Create Open Path"
It will prompt for the text file with your coordinates, open and create a stroked path on a new layer.

 

Attachments

Chris Mattock

Member
Messages
5
Likes
1
Some VERY minor adjustments needed due to the curvature of the earth and the chart not being totally square... but you've totally nailed it. Thanks SO much. That took me hardly any time. MUCH appreciated.

Thanks.PNG
 

Top