# Best way to run a .psjs script in Photoshop via C#?

**URL:** <https://forums.creativeclouddeveloper.com/t/best-way-to-run-a-psjs-script-in-photoshop-via-c/6915>\
**Category:** UXP Plugin API\
**Created:** [October 3, 2023, 11:49pm UTC](https://forums.creativeclouddeveloper.com/t/best-way-to-run-a-psjs-script-in-photoshop-via-c/6915 "2023-10-03T23:49:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zob](https://avatars.discourse-cdn.com/v4/letter/z/87869e/32.png) [@Zob](https://forums.creativeclouddeveloper.com/u/Zob)\
**Post date:** [October 3, 2023, 11:49pm UTC](https://forums.creativeclouddeveloper.com/t/best-way-to-run-a-psjs-script-in-photoshop-via-c/6915/1 "2023-10-03T23:49:43Z")

</div>

Running a \*.jsx file via C# can be done with the Photoshop.ApplicationClass.DoJavaScriptFile(filePath, argsArray, debugModeInt) command.

You can technically pass a \*.psjs file into that command and it will run, but the argsArray becomes mangled/corrupted on the way through.

Is there a better method available for running UXP scripts? I cannot find the docs for the ApplicationClass object anywhere online.
