Re: Property (variable)
Re: Property (variable)
- Subject: Re: Property (variable)
- From: John Delacour <email@hidden>
- Date: Tue, 2 Sep 2003 18:47:30 +0100
- Mac-eudora-version: 6.1a1
At 12:49 pm -0400 2/9/03, Steve Suranie wrote:
property howMany : 0
set howMany to howMany + 1
display dialog howMany
It works fine when I run it consecutively but once I quit it doesn't
retain the value but reverts back to 0. Am I doing something wrong.
I'm using OS X (10.2.6)
Properties are only saved if the script is an applet or if it is
loaded and then stored.
Try this and you will find that it does work:
set _scriptfile to "/tmp/junk.scpt" as POSIX file
try
_scriptfile as alias
on error e
store script junk in _scriptfile
end try
set _script to load script _scriptfile
tell _script
display dialog its n
set its n to (its n) + 1
end tell
store script _script in _scriptfile with replacing
script junk
property n : 0
end script
JD
.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.