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

Export Path to Illustrator

Community Beginner ,
Feb 14, 2022 Feb 14, 2022

Copy link to clipboard

Copied

Hi,

I'm running Ps 23.1.1 on a MacBook Pro M1 with Os 11.4 installed.

In Photoshop I'm trying to create an action that lets me open a .jpg file. Select color (RGB 0,0,0) --> Make a work Path --> export Paths to Illustrator. 

The action runs, but I end up with a bunch of .jpg files after the action is finished running.

It seems I'm only able to save this action as either .jpg/.PSD or .TIFF files.

How do I save "export Path to Illustrator" as .ai file when I run this action?

I'm really a beginner when it comes to Ps and Ai...hopefully it's not to hard.

Thx!

 

TOPICS
Actions and scripting , macOS

Views

2.8K

Translate

Translate

Report

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 2 Correct answers

Community Expert , Feb 14, 2022 Feb 14, 2022

A script that I made for previous forum discussion, all paths are saved into a single file (not as separate paths):

 

// Export All Paths to Illustrator Using Variable Document Name.jsx
// Only works with previously saved docs

#target photoshop

/*
Export all paths to Illustrator format using the current document name
This script is suitable for use in the File > Automate > Batch command
https://community.adobe.com/t5/photoshop/how-to-export-paths-to-ai-in-action-batch/m-p/11049923 
Based on th
...

Votes

Translate

Translate
Community Expert , Feb 14, 2022 Feb 14, 2022

This version will prompt for a save location if the source doc is unsaved. All paths are saved into a single file (not as separate paths):

 

// Export All Paths to Illustrator Using Variable Document Name.jsx
// Handles both saved and unsaved docs

#target photoshop

/*
Export all paths to Illustrator format using the current document name
This script is suitable for use in the File > Automate > Batch command
https://community.adobe.com/t5/photoshop/how-to-export-paths-to-ai-in-action-batch/m-p/
...

Votes

Translate

Translate
Adobe
Community Expert ,
Feb 14, 2022 Feb 14, 2022

Copy link to clipboard

Copied

One way: Actions panel menu, insert menu item and then select File > Export > Paths to Illustrator...

Votes

Translate

Translate

Report

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 Beginner ,
Feb 14, 2022 Feb 14, 2022

Copy link to clipboard

Copied

Thank you, I'm not sure I completely follow your way of doing this. Maybe I should mention that I would like to run this action as a batch...

 

Votes

Translate

Translate

Report

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 ,
Feb 14, 2022 Feb 14, 2022

Copy link to clipboard

Copied

Yes, knowing that you wish to batch this changes things greatly. The action method is not great for batching. The script is better suited to batching, however, the files need to be saved. I could change the script to work with both saved and unsaved files by updating the code.

 

You can record the script into an Action, then use the File > Automate > Batch command to run the action+script over multiple files.

 

Votes

Translate

Translate

Report

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 Beginner ,
Feb 14, 2022 Feb 14, 2022

Copy link to clipboard

Copied

Thanks for helping me out with this! I've attached a screenshot showing the action I recorded with the script included as you suggested above. The files are still saving as .jpg in the designated folder however. I'll also include a copy of the .jsx file that's loaded into Ps/Application/Presets/Scripts folder. Maybe there is an error with the way the file is saved?

 

Screen Shot 2022-02-14 at 10.43.53 PM.png

 

 

Votes

Translate

Translate

Report

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 ,
Feb 14, 2022 Feb 14, 2022

Copy link to clipboard

Copied

There are no paths in that screenshot?

 

Does the script work by itself, without being used in the action or batch?

 

You should be able to untick or delete the action step to export paths, as this is being performed by the script.

 

I can't see the full path to the script file name as the panel is not wide enough. Please post a cropped screenshot of the action panel with the panel wide enough to view the full path and name of the script.

 

The script needs to be saved with a .jsx filename extension, not .txt (which I can't see in the screenshot).

 

The issue may be with your File > Automate > Batch settings, please provide a screenshot of how that is setup.

 

Votes

Translate

Translate

Report

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 Beginner ,
Feb 14, 2022 Feb 14, 2022

Copy link to clipboard

Copied

It didn't let me upload the .jsx file format to the forum. But I basically renamed the .txt file and used .jsx as extension using textedit plain text. Here are the screenshots: 

 

Screen Shot 2022-02-14 at 11.31.36 PM.pngScreen Shot 2022-02-14 at 11.32.40 PM.png

Votes

Translate

Translate

Report

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 ,
Feb 14, 2022 Feb 14, 2022

Copy link to clipboard

Copied

You should only need the following as a bare minimum:

 

atn-batch.png

 

The script will export the .ai path next to the original file, so a destination of none is fine.

Votes

Translate

Translate

Report

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 Beginner ,
Feb 15, 2022 Feb 15, 2022

Copy link to clipboard

Copied

Thanks for sending a screenshot of the batch window. I can only select "Default" as the set and then I chose your sript in the action drop down window. With this set up the script is running and I'm able to run the batch! The only problem I'm experiencing now is that it will only save the .jpg files in the folder as .ai paths when the "Open" action is toggled on. So I have to select each .jpg file on at a time in the folder manually while the batch script runs. This is the only way it currently saves the .ai file in the folder. If I untoggle the first "Open" action the batch script runs through the entire folder of .jpg's but doesn't save them as .ai files. I'll include a screenshot. Not sure if I'm missing something with the way my batch is set up or if this is the way to run the script. It's already a tremendous time saver so thanks for helping me get it this far! Really appreciated. Thank you!Screen Shot 2022-02-15 at 11.57.47 AM.pngScreen Shot 2022-02-15 at 11.48.20 AM.pngScreen Shot 2022-02-15 at 11.50.01 AM.png

Votes

Translate

Translate

Report

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 ,
Feb 15, 2022 Feb 15, 2022

Copy link to clipboard

Copied

Your action is creating the paths on the fly, they don't currently exist in the document, that is fine, it is just a little more complex.

 

Disable or remove the open command in the action, batch will open the files for you.

Votes

Translate

Translate

Report

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 Beginner ,
Feb 15, 2022 Feb 15, 2022

Copy link to clipboard

Copied

Disabling the open command lets me batch run the script for the entire folder. Thank you so much for all your help. Amazing!

Votes

Translate

Translate

Report

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 ,
Feb 15, 2022 Feb 15, 2022

Copy link to clipboard

Copied

Glad you got there!

Please mark one or more answers that helped as correct to close off the topic, thanks.

Votes

Translate

Translate

Report

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 ,
Feb 15, 2022 Feb 15, 2022

Copy link to clipboard

Copied


@jf8526 wrote:

I can only select "Default" as the set and then I chose your sript in the action drop down window.

 

I would suggest that you create a new action set (folder) rather than leaving this in the Default Actions.

 

Then drag the action out of the default set into the new set.

 

Then save the new action set to .atn file.

 

https://prepression.blogspot.com/2017/01/photoshop-custom-action-file-backup.html

 

More here:

 

https://helpx.adobe.com/photoshop/using/creating-actions.html

 

https://helpx.adobe.com/photoshop/using/actions-actions-panel.html#about_actions_and_the_actions_pan...

 

https://helpx.adobe.com/photoshop/using/playing-actions.html#playing_and_managing_actions

 

Votes

Translate

Translate

Report

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 Beginner ,
Feb 15, 2022 Feb 15, 2022

Copy link to clipboard

Copied

LATEST

Thanks! I saved the .atn file in the folder with the files as well. Very helpful for future reference.

Votes

Translate

Translate

Report

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 ,
Feb 15, 2022 Feb 15, 2022

Copy link to clipboard

Copied

You obfuscated your User Path but it's exposed on other screenshots, incl. Actions panel.

Votes

Translate

Translate

Report

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 ,
Feb 14, 2022 Feb 14, 2022

Copy link to clipboard

Copied

A script that I made for previous forum discussion, all paths are saved into a single file (not as separate paths):

 

// Export All Paths to Illustrator Using Variable Document Name.jsx
// Only works with previously saved docs

#target photoshop

/*
Export all paths to Illustrator format using the current document name
This script is suitable for use in the File > Automate > Batch command
https://community.adobe.com/t5/photoshop/how-to-export-paths-to-ai-in-action-batch/m-p/11049923 
Based on the following topic thread:
https://community.adobe.com/t5/photoshop/exporting-all-paths-to-illustrator-error/m-p/8796143
*/

try {
    activeDocument.path;
    var doc = app.activeDocument;
    var docPath = doc.path;
    var docName = doc.name.replace(/\.[^\.]+$/, '');
    var newFile = File(docPath + '/' + docName + '_Paths' + '.ai');
    var expOptions = new ExportOptionsIllustrator();
    expOptions.path = IllustratorPathType.ALLPATHS;
    doc.exportDocument(newFile, ExportType.ILLUSTRATORPATHS, expOptions);
    // alert('All Photoshop paths have been exported as a single Illustrator file in:' + '\r' + docPath);
} catch (err) {
    alert('An image must be both open and/or saved before running this script!')
}

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

Votes

Translate

Translate

Report

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 Beginner ,
Feb 14, 2022 Feb 14, 2022

Copy link to clipboard

Copied

Where should I insert this script? Would you be able to walk me through, step by step?

Thx!

Votes

Translate

Translate

Report

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 ,
Feb 14, 2022 Feb 14, 2022

Copy link to clipboard

Copied

The instructions are at the link under the script (Downloading and Installing Adobe Scripts).

 

Quickstart:

  1. Copy the code text to the clipboard
  2. Open a new blank file in a plain-text editor (not word-processor)
  3. Paste the code in
  4. Save the text file as .txt
  5. Rename the file extension from .txt to .jsx
  6. Install or browse to the .jsx file to run

 

Votes

Translate

Translate

Report

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 ,
Feb 14, 2022 Feb 14, 2022

Copy link to clipboard

Copied

This version will prompt for a save location if the source doc is unsaved. All paths are saved into a single file (not as separate paths):

 

// Export All Paths to Illustrator Using Variable Document Name.jsx
// Handles both saved and unsaved docs

#target photoshop

/*
Export all paths to Illustrator format using the current document name
This script is suitable for use in the File > Automate > Batch command
https://community.adobe.com/t5/photoshop/how-to-export-paths-to-ai-in-action-batch/m-p/11049923 
Based on the following topic thread:
https://community.adobe.com/t5/photoshop/exporting-all-paths-to-illustrator-error/m-p/8796143
*/

var doc = app.activeDocument;
try {
    // Use the previously saved path
    var docPath = doc.path;
} catch (e) {
    // If unsaved, select the desktop
    // var docPath = "~/Desktop/";
    var docPath = Folder.selectDialog("Unsaved base file, select the output folder:");
}
var docName = doc.name.replace(/\.[^\.]+$/, '');
var newFile = File(docPath + '/' + docName + '_Paths' + '.ai');
var expOptions = new ExportOptionsIllustrator();
expOptions.path = IllustratorPathType.ALLPATHS;
doc.exportDocument(newFile, ExportType.ILLUSTRATORPATHS, expOptions);
// alert('All Photoshop paths have been exported as a single Illustrator file in:' + '\r' + docPath);

 

 

Votes

Translate

Translate

Report

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