Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text file timeout save and close



"Ken G. Brown" wrote:

[snip: unrelated to question]

> However, in the case that the user starts to enter some info, then gets
> interrupted and goes away, I would like the file to automatically save and
> close after a specified few minutes with no text entry activity, thereby
> saving the already entered info to that point.
> 
> I tried delaying after the open, but that has the side effect of not being
> able to run the script again before it has completed the timeout delay. In the
> case that the timeout save and close has not yet occurred and the user runs
> the same file open script again, I just want the already opened file to pop to
> the front.
> 
> So the question is, how can the save and close timeout be implemented?

Ken, you should check out the docs on 'idle' and how to implement an 'on
idle' handler.

As for the logic of implementation, you will likely have the best results
making a related, but separate, stay-open application that
polls/communicates with your script.  (You don't say what kind of script you
have now. That is, is it an applet? A compiled script?  A folder action?
Etc.)

Check the archives for 'on idle', but I've found a couple of references that
may be of use to you.


Some general info about 'on idle'...
<http://lists.apple.com/archives/applescript-users/2002/Jul/msg00197.html>


A more detailed message which shows an idle handler working with another
script handler...
<http://lists.apple.com/archives/applescript-users/2005/Aug/msg00707.html>


And from the ASLG, general section on 'Command Handlers'...
<http://developer.apple.com/documentation/AppleScript/Conceptual/AppleScript
LangGuide/AppleScript.e0.html>


...and specific section on 'on idle'...
<http://developer.apple.com/documentation/AppleScript/Conceptual/AppleScript
LangGuide/AppleScript.e7.html>


-- 
Gary

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Text file timeout save and close (From: "Ken G. Brown" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.