diff --git a/pype/hooks/photoshop/pre_launch_args.py b/pype/hooks/photoshop/pre_launch_args.py index b13e7d1e0f..6bd40eb2e1 100644 --- a/pype/hooks/photoshop/pre_launch_args.py +++ b/pype/hooks/photoshop/pre_launch_args.py @@ -20,13 +20,20 @@ class PhotoshopPrelaunchHook(PreLaunchHook): while self.launch_context.launch_args: remainders.append(self.launch_context.launch_args.pop(0)) + workfile_path = self.data["last_workfile_path"] + if not os.path.exists(workfile_path): + workfile_path = "" + new_launch_args = [ self.python_executable(), "-c", ( "import avalon.photoshop;" - "avalon.photoshop.launch(\"{}\")" - ).format(photoshop_executable) + "avalon.photoshop.launch(\"{}\", \"{}\")" + ).format( + photoshop_executable.replace("\\", "\\\\"), + workfile_path.replace("\\", "\\\\") + ) ] # Append as whole list as these areguments should not be separated