Have one ASOC script talk to another

Me again,

After some googling and experimenting I found that it would be best to split my one huge script into several pieces so that the UI doesn’t stop responding when a background task is doing its thing. I now have a small script that runs in the menu bar and I have another script that runs via LaunchDaemon without UI that does its thing and stores the information that matters in a plist file.

I would like the ASOC script that runs via LaunchDaemon to be able to “kick” the Menu Bar ASOC script and tell it to do something, like read the plist created by the other script and act on it. Or I would like to find an efficient way for the already running Menu Bar script to look for changes in the plist and then do something.

Is this even possible? If so, who would I go and “kick” the menu Bar script? And if it’s not possible, what options do I have to check regularly (like every other second) for changes without my Mac telling that my script “is defined to be constantly running and is inherently inefficient”.

Again, sorry of these beginner questions and I really appreciate the help that I got already from members of this forum, namely Shane and Stefan.

Thanks,
Dirk

It sounds like making your menubar app scriptable would work.

Thanks, Shane,

I found http://macscripter.net/viewtopic.php?id=36000 after some googling and I will try to add that code to my app tomorrow. I must admit that it’s way over my head though but I will give it a try. If you know of any better guide on how to add some scriptability to my Menu Bar app I would appreciate any advise you can give me.

Thanks,
Dirk

Well I do cover it in my book…

Found it in chapter 25, setting properties seems to be reasonable easy but commands, wow, I will need to do a lot more reading on that to get it.

That’s true – but for your purposes a property should work fine. Setting a property calls a handler in your script – in the sample in the book, setting the paragraph separator property calls setParagraphEnding: – and what you do in that handler is up to you. You can treat it as a command if you want.