Running Photoshop Action Script using C#

0

I am trying to run photoshop action script using C# console application but it is resulting in and error

System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM 
class factory for component with CLSID {99AEA70E-4D13-44BF-A878-33345CBFCBC8} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).

My code is

public static void RunAction(string orig, string target, string action, string group)
    {
        try
        {
            ApplicationClass app = new ApplicationClass();
            var doc = app.Open(orig);
            app.DoAction(action, group);
            var options = new BMPSaveOptions();
            doc.SaveAs(target, options, true, PsExtensionType.psLowercase);
            doc.Close(PsSaveOptions.psDoNotSaveChanges);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.ToString());
            Console.ReadLine();
            throw;
        }
    }

 RunAction(@"D:\ImageValidation\source\original.jpg", @"D:\ImageValidation\Destination\original1.jpg", "Resize", "Default");

I want to run a action script using C# Application that can perform some action on all images in the folder. But currently I am doing for single image.

c#
asp.net
photoshop
photoshop-script
asked on Stack Overflow May 11, 2018 by Akhilesh Sehgal

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0