From mboxrd@z Thu Jan 1 00:00:00 1970 From: patroclo7@gmail.com (Giorgio Lando) Date: Sat, 05 Jan 2008 18:11:10 +0100 Subject: [sup-talk] how to have an hook play a sound Message-ID: <1199552937-sup-9378@clarabella.clarabella> Hi again, I do not speak ruby and I am trying to write an after-poll.rb which plays a sound when there are new messages. I have tried several things, but probably I am misunderstanding something radical. I would like that it executes the sound when the variable @num (the number of polled messages) is >= 1. My less absurd try is perhaps: if @num>=1 system "/usr/bin/aplay -q " end but I get the following error: Error running hook: undefined method `>=' for nil:NilClass With: if @num!=0 system "/usr/bin/aplay -q " end The sound is always player, also when there is no new message polled. I have tried to define or declare a class or a method somewhere, but I am really lost. Any help? Giorgio Lando