Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!mintaka!olivea!samsung!usc!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!sics.se!ollef From: ollef@sics.se (Olle Furberg) Newsgroups: comp.sys.mac.hypercard Subject: Re: Idling in pre-2.0 HC Message-ID: <1991Jan10.214108.8066@sics.se> Date: 10 Jan 91 21:41:08 GMT References: <1991Jan10.142922.11037@usenet.ins.cwru.edu> Sender: news@sics.se Organization: Swedish Institute of Computer Science, Kista Lines: 50 In <1991Jan10.142922.11037@usenet.ins.cwru.edu> mike@pyrite.SOM.CWRU.Edu (Michael Kerner) writes: >AAAAAAugh! Ta det lungt. Ta en TOY! >Howdy, folks, I have a slight little problem I'm trying to work on: >I want to run something similar to a screen saver (actually, the idea is >similar - if HC is idle for so long I want to do something). As I understand it you must *pass* the idle to all other sort of scripts and especially to HyperCard itself. The idea of a "screen saver" written in HyperTalk is doomed to failure: as soon you get a dialog (like ask or answer), you could in no way dispose it through HyperTalk. It could be argued that it should be built in into HC some sort of "TimeForSomethingCompletelyDifferent"-message (together with a global property "EnoughTime"), but I will not do it here. My primitive solution is to look if the user changes the location of the mouse, and stores the mouselocation and the ticks into a global variable. I update this variable for every keydown or change in mouselocation. It's a small script and looks like this: on idle global theidle get theidle delete last item of it if the mouseloc is it then if (the ticks - the last item of theidle > 100) then answer "Get back to work!" put the mouseloc & "," & the ticks into theidle end if else put the mouseloc &"," &the ticks into theidle end if pass idle end idle on keydown global theidle put the ticks into last item of theidle pass keydown end keydown /Olle