Page 1 of 1

Tool - Can triggers be combined ?

Posted: Sun Feb 04, 2024 7:52 pm
by Blue
I would like a tool (caret) I use all the time to run when
either a newfile is created
or a file already opened in the Editor becomes active.
So, is there a way to do that (combining 2 triggers) ?

This tool (which sets the caret to a certain width, or thickness, if you prefer) used to run fine (and automatically) with the trigger "SourceCode loaded"... until PB 6.10 ! Now, I have to run it "manually" to get it going. However, when it finally does, it works way better than it did in PB 6.04.

Re: Tool - Can triggers be combined ?

Posted: Sun Feb 04, 2024 9:18 pm
by Little John
Hi,

perhaps you can set up 2 instances of that tool with differnt triggers? Not very elegant, but it might work. :-)

Re: Tool - Can triggers be combined ?

Posted: Mon Feb 05, 2024 3:58 am
by Blue
Thank you, Little John.

To my great embarassment, such a simple workaround never even entered my mind. As you say, though, not elegant. The sophisticated programmer in me feels reluctant.

But thank you just the same. I'll try it.

Re: Tool - Can triggers be combined ?

Posted: Mon Feb 05, 2024 8:20 am
by Bisonte
i do exactly this so that text blocks are inserted for me by allowing
only one instance (by the programm) and analysing the start parameters.

The first call starts the program, if it is not already started, and all
further calls only give "commands" to the program.
When the IDE is terminated, the programme also terminates. (Trigger)

Re: Tool - Can triggers be combined ?

Posted: Mon Feb 05, 2024 1:00 pm
by Blue
What are you talking about, Bisonte ?
I have read your post 20 times, and I still don’t have a clue.

Re: Tool - Can triggers be combined ?

Posted: Tue Feb 06, 2024 7:48 am
by Bisonte
I mean...

You create a "server application".

The program is started and waits... and only the parameters are evaluated when it is called again.

eg. : tool.exe -newsource, tool.exe -fileactive etc.

Helpful would be : https://www.purebasic.fr/english/viewto ... 40&t=58302

Sorry, but the translator sometimes does some pretty strange things ;)

Re: Tool - Can triggers be combined ?

Posted: Tue Feb 06, 2024 12:00 pm
by Blue
Thanks for clarifying things, Bisonte.
Much appreciated.

Your idea is original and interesting.
I'll give your approach a spin to see if it works better than calling 2 separate instances of the same program.