Copy link to clipboard
Copied
I'm using Photosho v21.1.0.
When I run an Action (script) and trying to save a file into a local directory (C:/temp) I get an Error message "Cannot save to C:/temp/C:/Temp/file.jpg". I get twice the directory name.
How to solve this problem ? Thank You
Copy link to clipboard
Copied
Where did you get this script? Seems like an issue with the code. Should be easy to fix though if the code is available
-Manan
Copy link to clipboard
Copied
I have created myself different scripts to save my images in different directories.
Copy link to clipboard
Copied
Can you post your script so we can see your source code like you can see it. We have no idea is what you have coded. All we know is there is an error in your save code. We can not tell you where your error is.
For example here is a save as jpeg function I may use. If you pass it that path it will fail.
function SaveAsJPEG(saveFile, jpegQuality){
var doc = activeDocument;
if (doc.bitsPerChannel != BitsPerChannelType.EIGHT) doc.bitsPerChannel = BitsPerChannelType.EIGHT;
jpgSaveOptions = new JPEGSaveOptions();
jpgSaveOptions.embedColorProfile = true;
jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
jpgSaveOptions.matte = MatteType.NONE;
jpgSaveOptions.quality = jpegQuality;
activeDocument.saveAs(File(saveFile+".jpg"), jpgSaveOptions, true,Extension.LOWERCASE);
}
Copy link to clipboard
Copied
If you have created the script then you could easily debug it using Extendscript or VSCode. Just set the break point where you are saving the file and see how the path is determined. If you have issues debugging the script then share it across, we.will have a look at it.
-Manan
Copy link to clipboard
Copied
I actually use Photoshop Actions (formerly called Scripts), to make a series of adjustments to tone, sharpness, cropping, etc., and then save the processed images in specific directories. It is during the saving process that the error appears.
What you're proposing is a scripting language that I don't master at all, sorry !
Copy link to clipboard
Copied
Actions were always part of Photoshop from what I remember. I started using Photoshop when Version PS 3 was current. Adobe made Photoshop Plug-in Scriptingsupport available as an optional download in Photoshop version PS 7. Scriptingsupport plug-in became a standard part of Photoshop in Photoshop CS version 8 of Photoshop. Actions have always been called Actions.
If you have a problem with an Action you recorded you should full expand the action in the actions Palette so you can read every step and all the setting recorded into your action foe each step to find out where your problem is. We can not see what you recorded unless you post you action sets .atn file here.
Copy link to clipboard
Copied
Upgrade to 21.1.2 or newer if your timing is right. If that still fails then please post your ATN file or the JavaScript you are running.
Copy link to clipboard
Copied
I think I found the solution in an old forum post :
Using Actions on version 21.1, the "save as" command creates bugs and generates an error message.
In my case, run an action that saves a file to 2 different folders as "save as". Saves to the first folder and I get the error "file name is invalid".
Just need to update Photoshop version to the actually version and this problem is gone !
Thank You to all the participants in this discussion