What opened a plugin?

Sarah Reichelt sarah.reichelt at gmail.com
Wed Aug 8 21:35:18 EDT 2007


> > I think this has been asked before, but I don't know if anyone came up
> > with a solution. I have a plugin in the Plugins menu and it opens
> > automatically when Rev starts. When it finishes it's task, I then want
> > it to close itself and go away. If it gets an error, it should stay
> > open - that is not a problem.
> >
> > The problem is if I want to edit it or it's setting later. I want a
> > way to detect whether it has been opened automatically on startup, or
> > whether it has been chosen from the plugins menu manually. If manually
> > opened, I don't want it to close when finished.
> >
> > There are ways around this, but I just wondered if there was any
> > in-built way to detect what was happening.
>
> You should be able to check the executionContexts from within
> preOpenStack to determine whether the stack was opened from the Plugins
> menu.

Thanks Richard, I use this in the preOpenStack handler:

   if the executionContexts contains "revmenubar.rev" then
       -- opened from the Plugins menu

And it works exactly as I wanted it to :-)

Cheers,
Sarah



More information about the use-livecode mailing list