Forum Replies Created

Page 1 of 3
  • Andy Kreutzberg

    October 15, 2013 at 3:33 pm in reply to: applescript: executing a jsx in after effects

    Hey again,

    a little update on this as i found a possible solution: The source of evil is the path of

    var report = new File (“Macintosh HD/Users/macname/generallog.txt”);

    Changing this to

    var report = new File (“/Users/macname/generallog.txt”);

    Makes the generallog.txt file work when the applescript executes the jsx file in ae. It’s still weird though because this means that as a result of running a jsx in after effects via applescript, there is a difference in how file paths within a jsx are being handled compared to when you just run a script without applescript.

    I am a bit confused, but thankfully this fix is rather simple even though i do not get the reason for this 😉

  • Andy Kreutzberg

    October 10, 2013 at 12:48 pm in reply to: applescript: executing a jsx in after effects

    So here is what i tried now:

    I placed the script with the File to evaluate in the startup folder and put the open file, eval file stuff within a function called RenderEnd (); I then tried to call this function via applescript. Guess what? It’s the same again. The File operations are still being ignored completely even though the function is executed.

    Now how come nobody ever ran into this issue? Apparently, it is not possible to have any sort of file handling operations within a jsx executed by applescript. That stuff will just get ignored as if it does not exist or something. Very strange.

  • Andy Kreutzberg

    October 10, 2013 at 11:32 am in reply to: applescript: executing a jsx in after effects

    Yes, allow scripts to write files thing is active. It’s interesting what you say about the UI Script, because the whole idea i am pursuing is in fact a UI script to control the aerender. So in the end, that particular UI Script should just have functions that an external script is calling via applescript.

    In the end, i would probably not have all these problems if the terminal was just able to make AE execute a script, but unfortunately, only the windows equivalent is able to do that while on mac you need the stupid applescript detour.

    Thanks a lot, Mitch. Your idea really opens additional possibilities. I will test it out. But maybe if somebody knows a radically different approach of telling an AE script that a process of aerender is done, feel free to chime in 😉

  • Andy Kreutzberg

    October 9, 2013 at 3:34 pm in reply to: applescript: executing a jsx in after effects

    I isolated the problem: When running a jsx script via applescript in after effects, the file.open() method does not work. It just returns an empty content. I found this out when i tried to call the notification script above as a nested script from another one executed by applescript.

    When i run the script containing the nested notification script manually, everything works. However, executing the script with the nested script via applescript does just nothing.

    Is there a solution for this problem? And if not, how would it be possible to have any script being executed after the aerender process is complete?

  • Andy Kreutzberg

    October 9, 2013 at 2:27 pm in reply to: aerender: How to change log location?

    The temporal solution i am using now is this:

    > generallog.txt

    it redirects the output from the aerender process to a textfile. Unfortunately, i am loosing the process indicators in the terminal (the new line for each completed frame while the renderer is active). Is there maybe a way to have both the process indication within the terminal and the output of a log to a specified location? the flag -log wont work for me for some reason. Even though i set all permissions for all folders to read&write, it still says i should check write permissions on the locations i give it via the -log flag. It just won’t let me change the log location.

  • Andy Kreutzberg

    May 7, 2013 at 3:21 pm in reply to: Scripting: The default Solids Folder

    The answer to my own question above:

    for (var i = 1; i<=app.project.numItems; i++) {
    if(app.project.item(i) instanceof FolderItem& app.project.item(i).numItems==0)
    app.project.item(i).remove()}

    This will remove any empty folders in the project window.

  • Andy Kreutzberg

    May 7, 2013 at 2:47 pm in reply to: Scripting: The default Solids Folder

    Just maybe another question in relation to this. I added a line to remove the empty solids folder. It goes like this:

    var SolidsFolder = app.project.item(6);
    SolidsFolder.remove();

    Now the problem is that when i run the script multiple times, the default solids folder will only be removed after the first time i ran the script. After the second time, my composition will be removed instead. I suppose this is because the new layers created by the script add up to the previously existing layers and thus having different index numbers, making the line…

    var SolidsFolder = app.project.item(6);

    …refer to my main composition instead. Is there a workaround for this so that at the end of the script, the empty default solid folder will be removed each time the script is executed? I suppose this would happen with a function?

  • Andy Kreutzberg

    May 7, 2013 at 2:23 pm in reply to: Scripting: The default Solids Folder

    Dan, you are a lifesaver! Thanks a million!

    I never would have thought about the .source attribute. The scripting guide can be a bit confusing when it comes to these things. I have looked endlessly through it and did not really find what you just pointed out (could not see the forest because of all the trees i guess).

  • Ah, i did not notice the missing characters after copy and pasting, sorry.

    Yes, there is backslashes.

    Basically, it should look like this:

    thisComp.layer(index).text.sourceText.split(/*backslash*n|*backslash*r/).length;

  • Basically, the line thisComp.layer(index).text.sourceText.split(/n|r/).length gives me the number of line breaks for a text. So i just wanted to put that into the code that looks at the range of layers to give me the maximum value for the line breaks of all the participating layers. So basically, i want to get the number of line breaks from the layer with the most line breaks.

Page 1 of 3

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy