user4426: What's the easiest way to trigger an aerender command from a web page?
Using Templater, I can create renders based on google spreadsheets, but I can't find a good description of how to trigger a render remotely.  Is there a good howto guide somewhere?  Maybe using PHP or something (not an expert on this)... PS: I'm using a Mac

user6685: Depends on which scripting languages your web server supports.
Main requirements

The language should be able to execute the application
The language should provide secure access the files on the server or a network
The language should provide methods to assembly file paths (e.g. relative to absolute paths)
The language should provide interaction methods for connecting the webpage (user input) and your application, also see: https://en.wikipedia.org/wiki/Web_application_framework


Execute aerender via python
Assuming your webserver supports python, execute the app via python's subprocess module. You only have to make sure that you can call aerender from your command line properly.
# import subprocess module to call aerender
import subprocess 

# create a aerender argument list
args = ['aerender', '-project', 'path_to_file']
process = subprocess.Popen(args, stdout=PIPE, stderr=PIPE)

In order to batch process a folder of .aep files you'll need to iterate through the files:
#import os module
import os 

# set the path to your aep folder
path = '/home/user/Desktop/aep-files'    # linux or osx
# path = r'c:\some\directory\aep-files'  # windows, the r is important
# path = 'c:/some/directory\aep-files'   # windows (alternative)

# make sure the files are .aep files
aep_file_folder = [f for f in os.listdir(path) if f.endswith('.aep')] 

# iterate through the list
for i in aep_file_folder:
    # setup correct filepath for aeps
    file_path = os.path.join(path,i)

    # call aerender with the correct arguments
    subprocess.call(['aerender', '-project', file_path])

Note: If there is no need to communicate (e.g. getting the output of aerender) you can simply use subprocess.call instead.

4426: <p>What's the easiest way to trigger an aerender command from a web page?</p>

<p>Using <a href="http://aescripts.com/templater/" rel="nofollow">Templater</a>, I can create renders based on google spreadsheets, but I can't find a good description of how to trigger a render remotely.  Is there a good howto guide somewhere?  Maybe using PHP or something (not an expert on this)... PS: I'm using a Mac</p>
 6685: <p>Depends on which scripting languages your web server supports.</p>

<h3>Main requirements</h3>

<ol>
<li>The language should be able to <strong>execute the application</strong></li>
<li>The language should <strong>provide secure access</strong> the files on the server or a network</li>
<li>The language should provide methods to <strong>assembly file paths</strong> (e.g. relative to absolute paths)</li>
<li>The language should provide <strong>interaction methods</strong> for connecting the webpage (user input) and <em>your application</em>, also see: <a href="https://en.wikipedia.org/wiki/Web_application_framework" rel="nofollow">https://en.wikipedia.org/wiki/Web_application_framework</a></li>
</ol>

<hr>

<h3>Execute aerender via python</h3>

<p>Assuming your webserver supports <a href="https://www.python.org/" rel="nofollow">python</a>, execute the app via <a href="https://docs.python.org/3/library/subprocess.html" rel="nofollow">python's subprocess module</a>. <em>You only have to make sure that you can call</em> <code>aerender</code> <em>from your command line properly.</em></p>

<pre class="lang-py prettyprint-override"><code># import subprocess module to call aerender
import subprocess 

# create a aerender argument list
args = ['aerender', '-project', 'path_to_file']
process = subprocess.Popen(args, stdout=PIPE, stderr=PIPE)
</code></pre>

<p>In order to <strong>batch process</strong> a folder of <code>.aep</code> files you'll need to iterate through the files:</p>

<pre class="lang-py prettyprint-override"><code>#import os module
import os 

# set the path to your aep folder
path = '/home/user/Desktop/aep-files'    # linux or osx
# path = r'c:\some\directory\aep-files'  # windows, the r is important
# path = 'c:/some/directory\aep-files'   # windows (alternative)

# make sure the files are .aep files
aep_file_folder = [f for f in os.listdir(path) if f.endswith('.aep')] 

# iterate through the list
for i in aep_file_folder:
    # setup correct filepath for aeps
    file_path = os.path.join(path,i)

    # call aerender with the correct arguments
    subprocess.call(['aerender', '-project', file_path])
</code></pre>

<p><strong>Note:</strong> If there is no need to communicate (e.g. getting the output of aerender) you can simply use <code>subprocess.call</code> instead.</p>
