• 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
Quit solution
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Quit solution


  • Subject: Quit solution
  • From: Jörgen Stahle <email@hidden>
  • Date: Thu, 02 May 2013 14:43:35 +0200

Hi there

I've written some huge stay-open-script-apps that runs on servers. They used to have a well-known problem with quitting – I got the error message that the app couldn't save data (sorry, I don't remember the error code) – and, worse, the app didn't quit. I have been trying to get around this problem by saving as much of the changing data in a property list instead of in Applescript properties, and in other cases by resetting the properties initial values. But with no success - maybe because the scripts are so big that I missed something.

Instead I have a workaround: In the quit handler, after some clean up measures being done, it just force quits itself. Like this (simplified example):

global gAppName
set gAppID to false
tell application "System Events"
set myPathH to (path to me) as string
set fullAppName to (name of alias myPathH)
set gAppID to unix id of process gAppName -- Script Editor should not be force quitted if runned from there
end tell

on idle
-- huge code mass
end idle

on quit
my doCleanUps() -- clean up ssteps
do shell script "kill " & my gAppID
end quit


Now, this workaround works fine! 
But my questions is: Can you see any drawbacks with his method? For example concerning memory usage on the machine?

Thanks in advance for any advice or information
Jörgen



Jörgen Stahle
Page production manager
TT-Gruppen
Phone:  +46 691 16 09
Cell:       +46 70 372 44 46
Mail:       TT-Gruppen, 105 12 Stockholm, Sweden
E-mail:    email@hidden

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

This email sent to email@hidden

  • Prev by Date: Solution to quit-problem
  • Next by Date: Re : uneditable [OT]
  • Previous by thread: Re: Solution to quit-problem
  • Next by thread: Re : uneditable [OT]
  • Index(es):
    • Date
    • Thread