BUG: Store script Perversity
BUG: Store script Perversity
- Subject: BUG: Store script Perversity
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 27 Dec 2002 22:48:42 -0800
I'm completely baffled. And once again I _cannot_ replicate with a short
script. But I've repeated it now about 100 times with a long script (100 K
text).
At the end of the main script run, it loads and stores another, short
script:
copy (current date) to currDate
set updaterScript to load script updaterScriptFile
tell updaterScript to set its recordedSync to currDate
store script updaterScript in updaterScriptFile replacing yes
Instead of storing the new 'recordedSync' property in updaterScriptFile ,
and saving its own changed properties when it quits, it stores ITSELF - the
entire 100 K script - in updaterScriptFile! And not in the usual fashion -
when I open updaterScriptFile in Script Debugger, it's as if I pasted in the
main script and compiled it! The original Updater Script is completely lost.
(Fortunately I had a backup.) Furthermore, all the properties of the main
script have been properly updated in this perverse transfer to
updaterScriptFile, but in the main script itself, no property has been
updated. The properties there are back to what they were before the main
script run!
So the whole main script instance in memory has been saved to the wrong
file. What in God's name is going on? The bug is with 'store script': if I
remove that line then the main script saves all its own changed properties
in itself, as it should.
Is this yet another bug with long scripts? As I say, I can't replicate with
two tiny scripts here: there's no problem.
And, before you ask, I've tried every alternative I can think of:
set updaterScript to load script updaterScriptFile
tell updaterScript to resetSyncDate(currDate)
store script updaterScript in updaterScriptFile replacing yes
which does the same thing, and
set updaterScript to load script updaterScriptFile
set updaterScript's recordedSync to currDate
store script updaterScript in updaterScriptFile replacing yes
which does the same thing. I've defined updaterScriptFile at the beginning
of the script and at the end - it makes no difference. (In fact, that part
works all too well.)
Has anyone ever seen anything like this?
AS 1.9.1 in OS 10.2.3.
--
Paul Berkowitz
_______________________________________________
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.