-
1. Re: afterfx command line "restores" maximized window - any way to duplicate ExtendScript invocation?
Arie Stavchansky Apr 14, 2014 1:56 PM (in response to adobe_sur2)If you use the -noui switch you shouldn't see the UI at all. Your script requires AE to show an alert dialog so it probably won't work though. Try making your script do something other than alerting the user and see if the problem persists.
-
2. Re: afterfx command line "restores" maximized window - any way to duplicate ExtendScript invocation?
adobe_sur2 Apr 14, 2014 4:25 PM (in response to Arie Stavchansky)Hi again,
Thanks for the comment. I was using the "alert" command just as a example but I did try it with other scripts which doesn't show a dialog message, with the "-noui" argument. The result is the same. I tried several combinations with "-noui", "-rq" and "-rquiet".
For example, here is one script which increases the frame duration: AfterFx.exe -r C:\path\frameDuration.jsx
--
Content of frameDuration.jsx:
--
var currFrameDuration = app.project.activeItem.frameDuration;
app.project.activeItem.frameDuration = currFrameDuration + 0.01;
--
Also, note that even if I don't put any argument and just execute AfterFx.exe (from the command line or from the start menu), the behaviour is the same - that is, if the After Effects application was maximized, it restores the window to the last known window which wasn't maximized. So I am wondering whether this is just how they coded AfterFx - to restore the window if the executable is launched while the application is still running. But if that is the case, I don't know how to control After Effects with scripts, from my own desktop application. If I put a script in the startup folder and use the Socket object to listen on a port for commands (from my desktop application), then it freezes the After Effects UI completely. I think I read somewhere that ExtendScript uses Bridge talk protocol to execute JavaScript files from the IDE. But I can't seem to find details as to how my desktop application can replicate what ExtendScript does to execute JavaScript files.
Thanks.
-
3. Re: afterfx command line "restores" maximized window - any way to duplicate ExtendScript invocation?
Arie Stavchansky Apr 15, 2014 6:50 AM (in response to adobe_sur2)Have you tried using something like PsExec to lauch AfterFX.exe? There are a good number of switches you can use there to handle how the process is launched. Also, maybe try to use Windows' command interpreter (cmd) to launch AfterFX.exe in the background.
Check out PsExec here:
http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx
--Arie
-
4. Re: afterfx command line "restores" maximized window - any way to duplicate ExtendScript invocation?
adobe_sur2 Apr 15, 2014 12:08 PM (in response to Arie Stavchansky)Hi,
Thanks again for your comments. I tried with PsExec just now but no luck still. The only useful argument parameter in PsExe seems to be:
-d Don't wait for process to terminate (non-interactive). But the same behaviour happens. I tried with "-e" as well (separately and combined with "-d").
I also tried a few command line argument options with "start" command, on the Windows Command prompt. For example:
"start /MAX AfterFx.exe -r C:\path\file.jsx" <-- supposed to start the application in the maximized state"start /b AfterFx.exe -r C:\path\file.jsx" <-- supposed to start the app without a creating a new window
But no luck still . Tried various combinations of the above two arguments as well.
Seems like Adobe After Effects explicitly does something weird to snap the application *out* of the MAXIMIZED state, if the executable is invoked (either via command line, with or without arguments or directly from start menu/GUI items). I don't know why they would do this though. I also wonder whether this is simply a bug in their implementation of Adobe After Effects CC on Windows 7.
Is there any way to MAXIMIZE Adobe Effects Effects through their JavaScript API? I am wondering whether I can explicility check/set the window to be maximized in my invoked script, to fix this behaviour.
Thanks.
-
5. Re: afterfx command line "restores" maximized window - any way to duplicate ExtendScript invocation?
Arie Stavchansky Apr 15, 2014 12:14 PM (in response to adobe_sur2)Sorry PsExec didn’t work out for you. The only thing I can think of for handling the AE window is using the application object. There is a app.activate(); command that “Opens the application main window if it is minimized or iconified, and brings it to the front of the desktop.” Does that help?
—Arie
-
6. Re: afterfx command line "restores" maximized window - any way to duplicate ExtendScript invocation?
adobe_sur2 Apr 15, 2014 12:29 PM (in response to Arie Stavchansky)Yah, I did try a few of those things to explicitly MAXIMIZE the Adobe After Effects instance. But no luck.
* AfterFx.exe -s "app.activate()" <-- just brings the app to the front of all the windows (even if minimized), it is not already the case. But the same issue exists if the app is maximized; it restores it back to the last known restore position. It does
I also tried :
* AfterFx.exe -s" app.activeViewer.maximize = true" <-- this sets the internal "viewer" to be maximized, within the bounds of the entire application. But this doesn't maximize the application itself. The same issue exists where the AfterFx application snaps the window out of the maximized state and puts it into restore state. I can't see any JavaScript attributes or functions to modify application level MAXIMIZE state.
I wonder if there is any other Windows specific command line way of *setting* an application to be maximized, after it has already been launched.
Thanks.

