Skip to main content
Participant
November 20, 2023
Answered

Issue with ExtendScript: Pasting Illustrator Path Data into Photoshop with Desired Path Format

  • November 20, 2023
  • 1 reply
  • 378 views

Hello,

I am currently working on implementing a script using ExtendScript to copy path data generated using Illustrator's trace feature onto Photoshop. The script is mostly functioning as intended, but I have encountered a significant issue.

When pasting the path data copied to the clipboard in Illustrator into Photoshop, the manual process involves the display of the "Paste As" window, allowing the user to specify the "Path Format." However, when pasting via ExtendScript, it is saved with the "Last saved format in Photoshop."

This poses a significant problem for me. I would like the script, regardless of the last operation performed in Photoshop via ExtendScript, to save in the "Path Format" when pasting.

Otherwise, I am required to manually save in "Path Format" before running the script each time, which is inconvenient.

I would greatly appreciate any guidance on a solution to this issue. Thank you in advance.

 

OS: Windows11
Photoshop: 24.7
Illustrator: 27.9
This topic has been closed for replies.
Correct answer jazz-y
var d=new ActionDescriptor();
d.putClass( stringIDToTypeID( "as" ), stringIDToTypeID( "path" ));
executeAction( stringIDToTypeID( "paste" ), d, DialogModes.NO );

1 reply

jazz-yCorrect answer
Legend
November 20, 2023
var d=new ActionDescriptor();
d.putClass( stringIDToTypeID( "as" ), stringIDToTypeID( "path" ));
executeAction( stringIDToTypeID( "paste" ), d, DialogModes.NO );
Participant
November 21, 2023

Thank you so much, jazz-y!

Your response was exactly what I was looking for and worked perfectly.