Friday, September 20, 2019

#1 2019-02-21 09:01:59 pm

minsmz
Member
Registered: 2019-02-21
Posts: 1

Photoshop save as PSB

Is there a way to save PSB files?
I looked up Photoshop dictionary, but there is anything like "PSB save options" When I try to save a file larger than 30000 pix as PSD format, the script stops at PSB save dialog. So I want to write a script that save the large files as PSB format without dialog.

Thanks,

Model: MacPro
AppleScript: 2.5
Browser: Firefox 45.0
Operating System: macOS 10.11


Filed under: Photoshop PSB

Offline

 

#2 2019-02-22 11:03:08 am

t.spoon
Member
From:: BFE, Massachusetts
Registered: 2013-01-13
Posts: 414

Re: Photoshop save as PSB

You can do it with Javascript, but it's less user friendly.

Applescript:

set POSIXsavePath to "/Volumes/Mackintosh HD/Users/[username here]/[rest of path]"
save_as_psb(POSIXsavePath)


on save_as_psb(filePath)
   tell application "/Applications/Adobe Photoshop CS6/Adobe Photoshop CS6.app"
       do javascript "
var idsave = charIDToTypeID( \"save\" );
var desc17 = new ActionDescriptor();
var idAs = charIDToTypeID( \"As \" );
var desc18 = new ActionDescriptor();
var idPhteight = charIDToTypeID( \"Pht8\" );
desc17.putObject( idAs, idPhteight, desc18 );
var idIn = charIDToTypeID( \"In \" );
desc17.putPath( idIn, new File( \""
& filePath & "\" ) );
var idDocI = charIDToTypeID( \"DocI\" );
desc17.putInteger( idDocI, 1124 );
var idLwCs = charIDToTypeID( \"LwCs\" );
desc17.putBoolean( idLwCs, true );
var idPrvw = charIDToTypeID( \"Prvw\" );
var list5 = new ActionList();
var idPrvw = charIDToTypeID( \"Prvw\" );
var idWnTh = charIDToTypeID( \"WnTh\" );
list5.putEnumerated( idPrvw, idWnTh );
desc17.putList( idPrvw, list5 );
var idsaveStage = stringIDToTypeID( \"saveStage\" );
var idsaveStageType = stringIDToTypeID( \"saveStageType\" );
var idsaveBegin = stringIDToTypeID( \"saveBegin\" );
desc17.putEnumerated( idsaveStage, idsaveStageType, idsaveBegin );
executeAction( idsave, desc17, DialogModes.NO );"

   end tell
end save_as_psb

Even if you perform a "save as" and provide a new file name, the Javascript doesn't record the file name. So I think this will always save with the current file name. If you need to save with a unique name, I'd just sav this way to a temp folder and then move/rename the file as needed with Applescript.

You may want different save settings than I used. You can find those with scripting listener, or let me know what your save settings are and I can modify this. If you need to use different save settings by script, the different permutations can be run with scripting listener and then changed in the AM code via applescript based on arguments passed to the handler.


Hackintosh built February, 2012 |  Mac OS Sierra
GIGABYTE GA-Z68X-UD3H-B3 | Core i5 2500k | 16 GB DDR3 | GIGABYTE Geforce 1050 TI 4GB
250 GB Samsung 850 EVO | 4 TB RAID
Dell Ultrasharp U3011 | Dell Ultrasharp 2007FPb

Offline

 

#3 2019-02-26 08:51:00 am

FredrikM
Member
From:: Förslöv, Sweden
Registered: 2019-02-19
Posts: 21

Re: Photoshop save as PSB

One way to do things with applescript and photoshop is to record what you want to do as a Photoshop action and then you can activate that action from the applescript.

Example:

Applescript:


tell application "Adobe Photoshop CC 2018"
           activate
           set display dialogs to never
do action "My Action" from "My Actionsfolder"
end tell

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)