rejetto forum

How to execute a macro?

r][m · 4 · 5839

0 Members and 1 Guest are viewing this topic.

Offline r][m

  • Tireless poster
  • ****
    • Posts: 347
    • View Profile
Anyone have an example of how to make a macro run
only when a link or button is clicked ?

To execute a macro like {.exec|C:\Hfs_Test\analog\analog.exe.}


Offline Foggy

  • Tireless poster
  • ****
    • Posts: 806
    • View Profile
the template is basically a script that outputs the HTML whenever a page is requested.

so if you only want to run a certain macro when you click a button you could either create a new template section [section] that has the macro and then call it when you need to /~section.

or you could use another macro in conjunction with the one you want to test for a certain post/get variable that will execute the macro when found.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
possible way

<form><input type='submit' name='action' value='run'></form>
{.if|{.?action = run.}|{:
    {.exec|whatyouwant.}
:}.}



macros are server side. to get the execution without refreshing the page, you must use ajax/ahah calls.


Offline r][m

  • Tireless poster
  • ****
    • Posts: 347
    • View Profile
I only had time to check it once from work tonight, but it
worked great !  :) Now I can run my log analyzer program
from another location and see the latest traffic anytime,
Just by clicking the button on a page.

This is awesome.  Many thanks Rejetto.