ScriptSpot

Forum topic · General Scripting

How to run commands on Reset?

By masquerade · 2009-01-22

Description

Hi,

I wrote a simple script to change some setups for my needs and put it into the startup folder. It changes default time range, playback rate, frame res. etc. Everything is fine, except when I reset Max, since it doesnt re-run the script, everything returns back.

Is there a quick way to run commands on reset?

 Thanks in advance.

Comments (2)

Stokes · 2009-01-22

Yes, indeed: you can do it via the general event callbacks.

 callbacks.addScript #systemPostReset "the_code_to_execute()" id:#someID

The stuff in quotes is a string that gets executed. It should probably be short, like a call to a function defined elsewhere. The ID is just for being able to name the callback for removal later. Even if you don't intend to remove it, give it an ID, anyway... it will make the script development much easier if nothing else.

 

 

masquerade · 2009-01-22

That was very helpful. Thanks Stokes.