Copy link to clipboard
Copied
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.) !
Copy link to clipboard
Copied
I don't see the shift or control getting recorded or available for playback in some other fashion.
Copy link to clipboard
Copied
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...
Copy link to clipboard
Copied
I realize this is an old thread but I need this capability. Were you ever able to solve this?
Thanks so much.
Scott
Copy link to clipboard
Copied
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)
Copy link to clipboard
Copied
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)
Copy link to clipboard
Copied
You can add filetype filters like this:
{"psd", "psb"}
Copy link to clipboard
Copied
Thanks for posting!
As there is no way to do this with ExtendScript (nor with UXP), my previous suggestion has been to try 3rd party keyboard macro software.
I don't use AppleScript, so it is good to know that for Mac users there is a native option!
Copy link to clipboard
Copied
The alternative is to use Bridge that is going to export layered files into .jpg's (resized if you need).
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
In lastest CC releases there's (improved) Export panel for it. In CS6 you need to use scripting.
Copy link to clipboard
Copied
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.