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!
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
...
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/
...
Copy link to clipboard
Copied
One way: Actions panel menu, insert menu item and then select File > Export > Paths to Illustrator...
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...
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.
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?
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.
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:
Copy link to clipboard
Copied
You should only need the following as a bare minimum:
The script will export the .ai path next to the original file, so a destination of none is fine.
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!
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.
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!
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.
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/playing-actions.html#playing_and_managing_actions
Copy link to clipboard
Copied
Thanks! I saved the .atn file in the folder with the files as well. Very helpful for future reference.
Copy link to clipboard
Copied
You obfuscated your User Path but it's exposed on other screenshots, incl. Actions panel.
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
Copy link to clipboard
Copied
Where should I insert this script? Would you be able to walk me through, step by step?
Thx!
Copy link to clipboard
Copied
The instructions are at the link under the script (Downloading and Installing Adobe Scripts).
Quickstart:
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);