• 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
Scope/Context issue?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Scope/Context issue?


  • Subject: Scope/Context issue?
  • From: Skeeve <email@hidden>
  • Date: Tue, 05 Feb 2008 01:32:24 +0100

The originating question (in German) is here http://www.fischer-bayern.de/phpBB2/viewtopic.php?t=2665

I have a ScriptA
-- -- -- -- -- -- -- --
property cntr : 0

on run
  set my cntr to (my cntr) + 1
  display dialog "A says: " & cntr
end run
-- -- -- -- -- -- -- --
Saved as an APPlication

And a ScriptB
-- -- -- -- -- -- -- --
on run
set a to load script file "Macintosh HD:Users:skeeve:Desktop:iScript:ScriptA.app"
tell a to run
end run
-- -- -- -- -- -- -- --


Now each time I run ScriptA, "cntr" gets incremented.

But running ScriptB, which in turn runs ScriptA, doesn't increment the counter. Okay. It does, but it's forgotten when you start again.

Can someone explain the background?

_______________________________________________
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: Scope/Context issue?
      • From: Kurt Klamp <email@hidden>
    • Re: Scope/Context issue?
      • From: Jon Pugh <email@hidden>
  • Prev by Date: Re: strings, again and again
  • Next by Date: Re: Scope/Context issue?
  • Previous by thread: Re: Scripting of Data Detectors again in OS X 10.5?
  • Next by thread: Re: Scope/Context issue?
  • Index(es):
    • Date
    • Thread