• 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: resetting script between runs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: resetting script between runs


  • Subject: Re: resetting script between runs
  • From: Chris Tangora <email@hidden>
  • Date: Mon, 4 Jun 2007 09:23:13 -0400

note that there is a difference between a global variable and a property. Your globals are NOT declared in the beginning of the script (before the on run). So you should nuke them out when you finish you script. I have a script that runs with multiple variables, it scans two separate folders and I don't want some rouge value from folder 1 used on folder 2 so I do this.

FreshStart()


on FreshStart() set variable_1 to {} set variable_2 to "" set variable_3 to null set variable_4 to false set varaible_5 to 0 -- zero end FreshStart

Then I continue on with my script running on the second folder. This gets me a fresh start every time it runs through a certain part of the script. Works for me.





On Jun 4, 2007, at 5:09 AM, Håvard Graudo wrote:

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.)

Håvard

---















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


This email sent to 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
References: 
 >resetting script between runs (From: Håvard Graudo <email@hidden>)

  • Prev by Date: Re: resetting script between runs
  • Next by Date: Re: resetting script between runs
  • Previous by thread: Re: resetting script between runs
  • Next by thread: Re: resetting script between runs
  • Index(es):
    • Date
    • Thread