Skip to main content
ericasp_
Participant
February 10, 2018
Question

Code to open PSD with 'read composite data' (shift+control+open file)

  • February 10, 2018
  • 4 replies
  • 1826 views

Hey!

Goal: Use a script to open a PSD with 'read composite data' to open the image/s flattened.

Use case/why: Significantly speed up the process of batch exporting big and heavy images.

When opening a document while holding down Shift+Control, Photoshop asks "Read the composite data instead?", and opens the file flattened. Which is faster than opening the whole file with all the layers. This saves time when opening very big files, which is handy when the only reason for opening the files are to export them quickly.

I have used ScriptingListener and consulted with the scripting documentation, plus some google-fu, without luck.

Is this possible to do with javascript within Photoshop?

(JS within Photoshop is of course preferred. The only other way I can think of (is a little outside of scope for this forum) is through an AppleScript outside of Photoshop to send the keystrokes to the OS, open the specified files in Photoshop and then steer Photoshop "from the outside", running actions etc. But I haven't found any example on the internet where pushing keys and opening can be combined, only as separate steps after each other.) !

This topic has been closed for replies.

4 replies

D Fosse
Community Expert
Community Expert
November 3, 2021

You can do the Export directly from Lightroom. It only works with the flat composite, and batching is what Lightroom was born to do. Select all the files, and ctrl+shift+E.

 

Lightroom exports to PSD, TIFF, jpeg or png, resized or not.

Kukurykus
Legend
November 1, 2021

The alternative is to use Bridge that is going to export layered files into .jpg's (resized if you need).

Participating Frequently
November 1, 2021

Thanks, we have a process that uses Javascript in CS6 and we want the files to open the composite data so it can be handled with the older version. Would be interesting to see if we could implement the workflow using Bridge.

 

Kukurykus
Legend
November 1, 2021

In lastest CC releases there's (improved) Export panel for it. In CS6 you need to use scripting.

Participating Frequently
November 1, 2021

I realize this is an old thread but I need this capability. Were you ever able to solve this?
Thanks so much.
Scott

Participating Frequently
March 7, 2024

Try this AppleScript. I can't figure out how to bypass the dialog, but this can be adapted to automate composite opening:

on openCompositeInPhotoshop(filename)
	tell application "System Events"
		key down {option, shift}
		tell application "PS for SL"
			activate
			set thisFile to filename as string
			open alias thisFile
		end tell
		key up {option, shift}
	end tell
end openCompositeInPhotoshop

set filePath to POSIX file "/Volumes/FOLDER/SUBFOLDER/SUBFOLDER/YOUR FILENAME HERE.psd" as alias
openCompositeInPhotoshop(filePath)
Participating Frequently
March 7, 2024

This is probably more helpful as it allows for the user to select multiple files for composite opening in Photoshop. Just hold down the "Return"/"Enter" key until finished!

on openCompositeInPhotoshop(fileList)
	tell application "System Events"
		key down {option, shift}
		repeat with thisFile in fileList
			tell application "Photoshop"
				activate
				open thisFile
			end tell
		end repeat
		key up {option, shift}
	end tell
end openCompositeInPhotoshop

-- Allow user to choose multiple files
set fileList to choose file with prompt "Select one or more files:" of type {"psd"} with multiple selections allowed

-- Convert fileList to alias list if necessary
set aliasList to {}
repeat with aFile in fileList
	set end of aliasList to aFile as alias
end repeat

-- Call the function with the list of file aliases
openCompositeInPhotoshop(aliasList)
Tom Ruark
Inspiring
February 16, 2018

I don't see the shift or control getting recorded or available for playback in some other fashion. 

Stephen Marsh
Community Expert
Community Expert
November 3, 2021

@Tom Ruark 

 

Couldn't something be done with psd read options for maximizeCompatibility with QueryStateType?

 

I'd post some code, but the syntax is killing me at the moment...