How to trigger (execute) code at startup of the image

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to trigger (execute) code at startup of the image

Georges
Hello,

Does anybody know how to execute code at startup of the image?
Something like returnFromSnapshot in vw

Thanks in advance,

Georges
Reply | Threaded
Open this post in threaded view
|

Re: How to trigger (execute) code at startup of the image

Sven Van Caekenberghe-2
Hi George,

> On 26 May 2017, at 10:44, Georges Kerssies <[hidden email]> wrote:
>
> Hello,
>
> Does anybody know how to execute code at startup of the image?
> Something like returnFromSnapshot in vw
>
> Thanks in advance,
>
> Georges

Check out the class SessionManager and its references/usages.

  SessionManager default addDeferredStartupAction: [ ... ]

Sven

Reply | Threaded
Open this post in threaded view
|

Re: How to trigger (execute) code at startup of the image

alistairgrant
In reply to this post by Georges
On Fri, May 26, 2017 at 10:44:56AM +0200, Georges Kerssies wrote:
> Hello,
>
> Does anybody know how to execute code at startup of the image?
> Something like returnFromSnapshot in vw
>
> Thanks in advance,
>
> Georges

Sven answered the question for code already in the image.  If you're
talking about automatically executing a file, take a look at the
StartupPreferences package.

And as a simple example, try the following startup.st:

StartupPreferencesLoader default executeAtomicItems: {
        StartupAction
                name: 'Startup Example'
                code: [
                        42 inspect.
                        ]
                runOnce: false.

}

Cheers,
Alistair

Reply | Threaded
Open this post in threaded view
|

Re: How to trigger (execute) code at startup of the image

Georges
In reply to this post by Georges
Thanks Sven and Alistair for your answers. I will try them both :)

Georges