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: resetting script between runs




Den 4. jun. 2007 kl. 12.03 skrev KOENIG Yvan:


Le 4 juin 07 à 11:09:10, Håvard Graudo a écrit :

How do I remove garbage from a script between runs?

I have a fairly complex script that sometimes fails. Freshly saved as an application it is 308k large. After a run it may be 544k.

Problem is it sometimes fails, and I cannot debug:
If I open it in an editor and just recompile it will always work again.
If it fails contantly as an application and I just open and run it directly from an editor it will also work.


I think I must reset something between runs, but what? Are there anything else than properties that should be saved between runs?

My 4 properties are three booleans (ie. debug: false) + a static string (path to a logfile).
I have three globals. Globals are not saved between runs, right?


Any advise in strategy to choose? How do I get to see what actually fails. (The script may run fine for weeks after a compile.)


Den 4. jun. 2007 kl. 12.03 skrev KOENIG Yvan:
Hello

Before quitting the script, some complementary instructions may reset the offending properties to initial, clean values.

With that, your script will always restart on clean basis.


Den 4. jun. 2007 kl. 11.27 skrev Richard Mayer:
Not being remotely an AS expert, this is just a stab in the dark, from a programming point of view;

Could the problem be that your logfile is not getting closed properly?

No, globals are not saved between runs, but maybe you're saving some sort of preference?

I can only think you're probably saving some kind of persistant data that's screwing things up now and again.

Cheers,
Rich




Thanks for your inputs. I do not write prefs to any files. I have one logfile only, and I am quite sure it is closed properly. The script does not read anything back from the logfile.


The 3 booleans are for developement only. The string is static just providing a file name for the logfile handler.

property debug : false
property readonly : false
property FascistLogging : false
property Logfilnavn : "name of this scripts logfile.log"

The properties are not changed by the script during execution. Are there anything else than properties that are supposed to be stored in the script file that I can reset at the end?

Since a recompile of the script itself solves the problem I think it is not an external file. (But since I cannot find the culprit, what I think is obviously quite worthless...)

Håvard








_______________________________________________ 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: 
 >resetting script between runs (From: Håvard Graudo <email@hidden>)
 >Re: resetting script between runs (From: KOENIG Yvan <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.