Copy link to clipboard
Copied
Hi,
I'm still not very familiar with the PS CS4 object model and I'm wondering whether I can trigger the execution of a menu command from a script.
My purpose is to fix the CS4 issue with some plugins that have a bug causing some elements of the PS CS4 interface (like the Arrange Documents drop down menu) to appear blank when hovered with the mouse. This problem usually disappears when launching these plugins. For example, you'll have the problem when installing Nik Software's Silver Efex (they promised to fix this in February but we're still waiting). Launching "File | Automate | Nik Selective Tool" and then closing the dialog fixes the issue... until you re-launch PS.
So I want to do that automatically when PS starts. I tried with an action which I attached to the startup event but the action is not launched (probably because the plugin is not active yet). So I tried the scripting way but I don't see how I can launch a menu command automatically.
Thanks in advance.
--
Patrick
Copy link to clipboard
Copied
In CS4 there is a runMenuItem method but I don't know if it works with plugins. And I would think that if the action is not working in the startup event because the plugin is not yet loaded a script would have the same problem as it would be run at the same point in the startup.
Are you sure the reason for not working is the plugin is not loaded? Have you tried a different action that does not need a plugin to see if you are setting the event correctly?
Copy link to clipboard
Copied
Hi Michael,
Thanks.
Yes, I'm setting the event correctly. I checked this. There's not much room for a mistake anyway. You enable events to run scripts and action, you select the event, you select the action, click on Add and voilà .
--
Patrick
Copy link to clipboard
Copied
The reason I asked is most filters need an open document. I thought the reason it was not working could be that there in no image to filter at startup.
But as I said I don't have nik plugins so I could be wrong.
Copy link to clipboard
Copied
Michael,
Opening the Nik Selective Tool doesn't require having an open document.
--
Patrick
Copy link to clipboard
Copied
Michael,
I forgot to mention that if I run this action manually "after the fact" from the Action Manager (once PS has loaded everything and is idle), the action works and the bug is fixed for that session. This is why I think that there's a "loading order" problem somewhere. I could not find any information about what the "Start Application" event really is, that is, about when it is actually triggered. Before or after all the plugins are loaded? Before appears to be the right answer... No luck.
--
Patrick
Copy link to clipboard
Copied
If you have Bridge running, have a script run at PS startup that sends some code to Bridge.
The Bridge code does a $.sleep(10000) then sends some code back to PS to run the action.
This results in a delayed execution of the action.
You may also be able to have the startup script send the message to PS and bypass Bridge altogether.
But get the Bridge version working first.
-X
Copy link to clipboard
Copied
Most events that I have used run the script after the event but I'm not sure about the startup event order either.
You might try add the creation of a new doc to your action. Then after the nik step close the doc without saving. That may force Photoshop to wait until the plugin loads before running the action.
Another thing you could try is create an script that calls your action. Something like
doAction( 'run Nik', 'startup actions' );// action name, action set. I don't think that will help but its simple and might work.
If that doesn't work then I can help you with a script that you can attach to a different event. It check to see if it's been run before and if not run your action. You could attach the script to all events to make sure it gets run soon after startup.
Copy link to clipboard
Copied
Thanks Michael, xbytor2,
Well, I have the feeling that a simple idea aimed at fixing an annoying and lasting bug is slowly evolving in a circonvoluted construction... . I'll try to see first whether Nik Software has something new to say about this. If not, I'll try your ideas.
Thanks again and best greetings from Paris.
--
Patrick
Copy link to clipboard
Copied
Oooops! Sorry for the id change. I am MainSoft too.
--
Patrick
Find more inspiration, events, and resources on the new Adobe Community
Explore Now