Opened 14 years ago

Closed 13 years ago

#750 closed Defect (Works for Me)

On idle handler isn't called

Reported by: Mickey Owned by: timothy
Component: Colloquy (Mac) Version: 2.1 (Mac)
Severity: Major Keywords: plug-in applescript
Cc:

Description

Hello,

In a plug-in, the following

on idle

set idletime to idletime + 1

end idle

does not seems to work anymore (e.g. the Away Nickname does not count time anymore).

It was related to #673 in my mind but the scope of this one seems to have changed to processing incoming text in AppleScript?.

The last nightly build it was working in is 2D41

Thanks for your wonderful IRC client !

Change History (2)

comment:1 Changed 13 years ago by rinoa

  • Summary changed from On idle handler seems no more to be called to On idle handler isn't called
  • Version changed from Latest Nightly to Latest 2.1

A little supplemental information about this:

I just saw that if you stay in a private discussion with someone window, in that case, the idle handler seems to be called...So it may be only when you are idle and viewing a normal room that the on idle handler is not called at regular times... For the record, I use now the latest Version 2.1 (3358).

comment:2 Changed 13 years ago by timothy

  • Resolution set to worksforme
  • Status changed from new to closed

More info from http://developer.apple.com/documentation/AppleScript/Conceptual/AppleScriptLangGuide/AppleScript.e7.html

Remember that the result returned from a handler is just the result of the last statement, even if it doesn't include the word return explicitly. For example, this handler only gets called every 15 minutes.:

on idle
    set x to 30
    beep
    set x to x * x  -- The handler returns the result (900).
end idle

To make sure you're not changing the idle rate, return 0 at the end of the handler.

So in your example the idle time used will continue to increase until the number of seconds is so large it seems like the idle handler never fires.

Note: See TracTickets for help on using tickets.