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.
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;
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:
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.
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?
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 :
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.
I would like to know if you have found a solution yet.
This is really ***ing me off too. One tolerable solution is to drag corners of AE window to just near edges so it is almost maximized, then when sending script it will stay in this "restored" position. Not ideal. Can't believe there isn't a command that can be sent via cmd.exe to simply maximize a running instance of a window.
1 person found this helpful
Ahhh - and just found out if you do that via placement of the window and then ctrl +\ to hide the titlebar, then AE will occupy a maximized position when firing a script at it from somewhere else... that works. Win 7 64 - AE CC 2014.
Still... but that doesn't really solve the problem, does it? I am fighting with this issue as well.... Still no solution, other than check the state of the window before running a command, then run the command, and then force set the window to the same state... haven't tried it yet, but in theory it should work, though the movement of the window will probably be visible.
I came up with basically what you suggested using AutoHotkey and a keyboard shortcut. Here an example Autohotkey script:
#1:: ;Shortcut combination is Windows key + 1
WinGet, minmax_state, MinMax, A ;Gets current Min/Max state of active window
Run AfterFX.exe -r scriptfile.jsx ;runs script
if minmax_state = 1 ;if window was previously maxmized
Sleep, 100 ;sleep so script is at least starting to run
WinMaximize, A ; maximizes active window
There's a visible restoring and then maximizing back like you predicted but it's pretty quick.
You do need Autohotkey installed, although you can super easily convert an Autohotkey script to an exe file (just right click script file -> compile) if you need to move it around.
Not sure how it'll work with slow scripts - sleep might need to be slightly longer.
Still - not a solution, just a workaround