• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Add final step to Action/Macro Script: Minimize Photoshop window

New Here ,
Feb 28, 2023 Feb 28, 2023

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: 

  • Browse through images with my photo viewer
  • Send bad samples to Photoshop
  • Press F2 to trigger my edit photo macro (works well)
  • It saves & closes the workspace as inteded and I have to minimize Photoshop manually to resume my work.

 

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.

TOPICS
Actions and scripting , Windows

Views

1.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Feb 28, 2023 Feb 28, 2023

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 28, 2023 Feb 28, 2023

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 28, 2023 Feb 28, 2023

Copy link to clipboard

Copied

quote

... 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:

 

https://community.adobe.com/t5/photoshop-ecosystem-discussions/photoshop-action-helper-scripts/td-p/...

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 03, 2023 Mar 03, 2023

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. 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 28, 2023 Feb 28, 2023

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.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 01, 2023 Mar 01, 2023

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. 🙂

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 03, 2023 May 03, 2023

Copy link to clipboard

Copied

LATEST

Multiple files are processed and converted by the image processor. The Image Processor, in contrast to the Batch command, allows you to process files without first generating an activity. In the image processor, you can perform any of the following tasks:

  1. Convert a group of files to the JPEG, PSD, or TIFF formats separately or all three at once.
  2. Use the same settings to process a collection of camera raw files.
  3. Image resizing to fit inside predetermined pixel boundaries.
  4. Save a collection of files as sRGB conversions or colour profiles and save them as JPEG images for the web.
  5. Copyright metadata should be included in the transformed photos.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines