• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Stay-open applet - problems on quitting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stay-open applet - problems on quitting


  • Subject: Re: Stay-open applet - problems on quitting
  • From: julifos <email@hidden>
  • Date: Fri, 14 Nov 2003 11:31:37 +0100

>> The "robust method" may depend on what's going on in your code...
>
> Usually just this:
>
> to getBaseData()
> tell application "System Events"
> set apn to name of processes
> set fpn to name of first process whose frontmost is true
> end tell
> return {(current date), apn, fpn}
> end getBaseData

[...]

> It would be fine if it actually quit, but it returns to what it was
> doing before. I guess there'll be a way of dealing with it...

Perhaps I'd try a simple try... end try, would be less intensive. For
example, if you observe that errors are allways about "undefined varialbes",
you can use this:

######################
on idle
try
getBaseData()
on error msg number n
if n = -2753 then --> undefined var
quit --> go to quit handler
else
--> let the user know?
end if
end try

return 1
end idle
######################

Or define a global checking:

###################### * untested code
global reallyQuit

set reallyQuit to false

on idle
getBaseData()
if reallyQuit then quit
return 1
end idle

on quit
if reallyQuit then
continue quit --> quit now
else
set reallyQuit to true --> let finish the idle handler
end if
end quit
######################


jj
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Stay-open applet - problems on quitting
      • From: Richard Morton <email@hidden>
  • Prev by Date: Re: Export Image From FileMaker
  • Next by Date: Filtering Mail by content.
  • Previous by thread: Re: Stay-open applet - problems on quitting
  • Next by thread: Re: Stay-open applet - problems on quitting
  • Index(es):
    • Date
    • Thread