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

How to go from SVG to format for PathItem

Participant ,
Aug 11, 2022 Aug 11, 2022

Hi, all!

Asking for scripting advice. I’m working on a javascript for adding fake negative borders to photos in Photoshop. A crucial step for me is to be able to convert a SVG from a common vector illustration app to a format I can use with Document.pathItems, to add to the document collection of PathItems, then change it to a working path and then convert that to a selection.

 

What would you say the easiest way to get from a SVG to a format a could use for a PathItem?

I have a little bit of experience with coding, but none with scripting PS...

 

Thank you in advance!

TOPICS
Actions and scripting , macOS
355
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
Adobe
Community Expert ,
Aug 13, 2022 Aug 13, 2022

Funny, search results seem to indicate that most people want to go the »other way«. 

 

Quite frankly I would rather open the svg-file in Illustrator and collect the points there (or copy/paste them to Photoshop and collect there). 

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 ,
Aug 13, 2022 Aug 13, 2022

Yeah, I abandoned this approach and went with drawing paths directly in PS and exporting them from there, as in that other script you've been helping me with!

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
Community Expert ,
Aug 13, 2022 Aug 13, 2022
LATEST

It should be possible to read the svg to extract the information, but svg seems to represent a path’s points in a rather different way than Photoshop. 

So unless it is a very frequent task it might not be worth the trouble. 

https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths

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