Pixnub Home Page 2 Forums EZ Green Screen EZGS Extract Image command Reply To: EZGS Extract Image command

#7026913
Damon Bell
Keymaster

    OK, so I figured out how to fix this. Please test this download. Make sure you are testing the new download named test-2 and not the first one.

    https://pixnub.com/downloads/ez-green-screen-8-0-2-test-2.ccx

    Use these commands.

    
    plugin.showPanel("ezgs8");
    plugin.invokeCommand("ezgsCommand");
    
    

    IMPORTANT NOTE: If EZ green Screen hasn’t been opened during the Photoshop session then the first time you run it it won’t work because Photoshop won’t wait for plugin.showPanel to open the panel before running the invokeCommand. So it can’t run EZ Green Screen. I can’t figure out any workaround to make it wait for that and await doesn’t work for that.

    However, after you have opened EZ Green Scree once, even if it is currently closed, it will work. So you need to make sure you have opened the panel at least once prior to running. Also, you can omit the showPanel step too. As long as EZ Green Screen has been opened once, it will work without sowing the panel, even if the panel is closed.

    Using await before plugin.showPanel or plugin.invokeCommand doesn’t seem to do anything. However, it seems that await is built into plugin.invokeCommand. In order to make it work properly, you must use async/await inside of the entrypoints.setups function (the one in EZ Green Screen). Then EZ Green Screen won’t send the “completed” signal until it has finished. Then the 3rd party plugin won’t process until EZ green Screen has completed.

    You don’t need to put this code anywhere, but just FYI in case you ever want to batch one of your plugins with another plugin.

    
    entrypoints.setup({
       
    commands: {
    "yourCommandID": async function() {await yourFunction();},
    }
        
    });
    
    

    Asynchronous JS a huge pain in the butt.

    Please let me know if this work when you test it.

    • This reply was modified 3 months, 1 week ago by Damon Bell.
    • This reply was modified 3 months, 1 week ago by Damon Bell.
    • This reply was modified 3 months, 1 week ago by Damon Bell.