Copy link to clipboard
Copied
For the life of me I can't find any information on this topic. I even tried chatGPT before coming here.
Here is my workflow:
My problem: I can't find any hotkey, setting, macro, action, ANYTHING to tell Photoshop to minimize the window in the final step of the macro. Is there anything I can do? Any help and guidance is greatly appreciated. Running on v23.1.
Copy link to clipboard
Copied
I am not aware of a way to do this via an action. I am not aware of a direct way to do this with a script, however, one can indirectly do this by bringing another program to the front (Finder on Mac, File Explorer on Win or another program. Such a script could be incorporated into the action.
Are you looking for a Mac, Win or cross-platform solution?
Copy link to clipboard
Copied
Thanks for the answer Stephen. I'm looking for a Windows solution, so ideally I'd like to bring my photoviewer (Irfanview) back to the foreground. That sounds promising, I wasn't aware that it was possible to incorporate that into an action?
Copy link to clipboard
Copied
... I wasn't aware that it was possible to incorporate that into an action?
By @Too Long23393079qrki
Yes, scripts can be used by an action!
You may find the following "Action Helper Scripts" useful, or at least informative:
Copy link to clipboard
Copied
For photoshop, save as .jsx file:
app.system("powershell -command \"(Get-Process -Name Photoshop).MainWindowHandle | ForEach-Object { if($_){$sig = '[DllImport(\\\"user32.dll\\\")] public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);';$win32 = Add-Type -MemberDefinition $sig -name Win32 -namespace Win32Functions -PassThru; $win32::ShowWindowAsync($_,2)}}\"");
I found your post because I was looking for others who use chatgpt. This was made with chatgpt. The window minimizing is not instant and takes ~1.2s to work.
Copy link to clipboard
Copied
@Too Long23393079qrki – The following script will run IrfanView:
/*
Run IrfanView from Photoshop.jsx
https://community.adobe.com/t5/photoshop-ecosystem-discussions/add-final-step-to-action-macro-script-minimize-photoshop-window/m-p/13616016
*/
runIrfanView();
function runIrfanView() {
var os = $.os.toLowerCase().indexOf('mac') >= 0 ? "mac" : "windows";
if (os === 'mac') {
alert("This script is only intended for Windows OS!");
} else {
try {
var progPath = "C:\\Program Files\\IrfanView\\i_view64.exe";
var progPathOpen = File(progPath);
progPathOpen.execute();
} catch (e) {
alert("Error!" + "\r" + e + ' ' + e.line);
}
}
}
Information on saving, installing and running scripts is here:
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html
Once installed into the Presets/Scripts folder, you can record it as a step into the action from File > Scripts using a relative name (suggested for use on multiple PCs).
If you alternatively use the File > Scripts > Browse... command, the full absolute path to the script will be used instead.
Copy link to clipboard
Copied
Have you tried creating a droplet?
In a nutshell: it wraps a photoshop action or script in an exe file on which you can drag&drop files or folders.
If Photoshop is minized when the images are dropped on the droplet, it tends to stay minimized.
You might be able to drag & drop your images from irfanview onto the photoshop droplet...
Fingers crossed. 🙂