I’m starting the conceptual work on a project that I’ve been given to create a NTN-style live quiz setup(those quiz games in pubs). I need to set up a laptop that will be sort of a quiz server and then a set of other laptops that will be the “contestant” laptops. So, for now as proof of concept, I want to make a script on the central computer that runs and listens for feedback from the other computers and then a little script on the other computers that sends the main computer the keystroke that was just pressed.
I’m at least an intermediate level scripter, but I’ve never tangled with remote event scripting or stuff like this, so I was wondering if anybody had any starter ideas or suggestions where I could find some good references on this sort of thing?
I don’t think applescript will work how you want for this project. You really need a coca application which can listen on specific ports as the server and client applications that can send information over those ports to the server.
However if you wanted to try applescript, you could try something like this. Suppose you have an application called TestQuestions. This would be a stay-open applescript application. It would contain the following code.
property theQuestions : {"Question 1?", "Question 2?", "Question 3?"}
on returnAQuestion()
return some item of theQuestions
end returnAQuestion
Run this stay-open application… this would act as the “server” application. Then a client application could be like this…
tell application "TestQuestions"
set myQuestion to returnAQuestion()
end tell
display dialog myQuestion
When you run the client application you will see that it can retrieve information from a server application by targeting a subroutine in the server application. So you would need to create many subroutines in the server application that could supply information to the client applications.