I believe I may have found a way to do this using Powershell but I need to be able to call the Powershell script from the Photoshop script. Does anyone know how to do this? Or even the other way around, call a Photoshop script from a Powershell script?
Install the ScriptListener plugin temporarily.
Open any file
Call Menu-> File-> Print ...
Select the first printer, configure printer settings and click "Done"
Call Menu-> File-> Print ...
Select the second printer, configure printer settings and click "Done"
Post here the link to ScriptingListenerJS.log file.
Close photoshop. Remove the ScriptListener plugin.
I was able to figure out a solution. I created an action for each printer/size combination in Photoshop. I created a Photoshop script to iterate through the images in the size folders and calls the appropriate action. And finally I created a PowerShell script for each size/printer combo that sets the default printer and calls the Photoshop script. I put shortcuts on my desktop for each size/printer PowerShell script that I can right-click on and run with PowerShell.
I had no chance to focus on attempt to do what you wished, but now when you say you figured out solution I'd like to see Photoshop and Powershell scripts you wrote. No enough life to learn everything myself. So if you would be so kind could you please share them with us? That may be useful for me in future and probably some other users from here. Thank You.
1 person found this helpful
Sure. The following are examples for the 5x7 folder for the R3000 printer. I made separate ones for each size and printer. This is the Photoshop script that iterates through the 5x7 image folder and calls the action.
sourceFolder = new Folder("D:\\5x7");
files = new Array();
files = sourceFolder.getFiles("*.jpg");
if (files.length > 0)
for (i=0; i < files.length; i++)
var doc = app.open(files[i]); // returns the document object
app.doAction("5x7 Print - R3000", "Print R3000");
alert('No files found.')
This is the PowerShell script that sets the default printer to the R3000 and calls the above Photoshop script.
$PrinterName="Epson Stylus Photo R3000(Network)"
$DefaultPrinter=Get-WmiObject Win32_Printer -Filter "Name='$PrinterName'"
& "C:\Program Files\Adobe\Adobe Photoshop CS5 (64 Bit)\Photoshop.exe" -run "D:\My Files\Photoshop\Scripts\R3000 - Print 5x7.jsx"
This will not work (you can check) if you are trying to print a file that was already printed on another printer and then saved. Also the "-run" key does not make sense for a photoshop. For him, the key is the file extension, in this case ".jsx".
Print the file to any printer, regardless of where it was previously printed using scripts that the ScriptListener plug-in gives and whose data I requested.
P.S. I hope Google translate correctly )
The script I posted was in answer to my own question. I can verify that yes it does work. I have been using it now for several days without any issues.