• 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: "J. Stewart" <email@hidden>
  • Date: Mon, 4 Jun 2007 08:31:44 -0400

On 6/4/07 at 5:09 AM, Håvard Graudo <email@hidden> spake thusly:

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?

Nope, that would be wrong, they are saved. (see below)

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

Set your properties and globals back to their default values or empty at the end of the run. Declare other variables as local.


Re: Globals, run this script in your script editor and watch the value of "f" at the completion of each run.

--> Cut <--
global f
try
	set f to 1 + f -- errors on first run
on error
	set f to 1 -- first run only
end try
return f
--> Cut <--

JBS
--
Why is a person, who plays the piano, called a pianist but a person who drives a race car not called a racist? - George Carlin
_______________________________________________
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
  • Follow-Ups:
    • Re: resetting script between runs
      • From: Håvard Graudo <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