Re: Script Menu in Tiger: non-persistent property bug?
Re: Script Menu in Tiger: non-persistent property bug?
- Subject: Re: Script Menu in Tiger: non-persistent property bug?
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 07 Aug 2005 08:28:26 -0700
- Thread-topic: Script Menu in Tiger: non-persistent property bug?
Confirmed. And it has nothing to do with Script Editor itself, nor even Data
Fork scripts. The same thing happens with compiled scripts made in Script
Debugger 3, both Data Fork and Resource Fork scripts. It also has nothing to
do with just getting the value after defining it (like in the iApps).
Interpolating an extra line or lines after setting n makes no difference.
--------------
property n : 1
display dialog "Test #" & n
set n to n + 1
n
if n < 4 then n
--------------
If you add a simple
return
at the end, then it never progresses past #1 - no changes are ever saved.
But return any "dummy" value - as you say - like 101 - and it keeps
incrementing every time.
Oy.
--
Paul Berkowitz
> From: kai <email@hidden>
> Date: Sun, 7 Aug 2005 13:06:05 +0100
> To: applescript-users Users <email@hidden>
> Subject: Script Menu in Tiger: non-persistent property bug?
>
> Just having a great time wading through some old scripts that broke
> in my last upgrade... ;-)
>
> One thing was puzzling me particularly: When run from the Script
> Menu, some scripts were retaining changed properties - while others
> weren't. All scripts worked as expected when run as an application,
> or from Script Editor - but not (in every case) from the Script Menu.
>
> After much digging (not to mention some head-banging), I believe that
> I may have identified the differentiating factor between those
> scripts that work correctly and those that don't. If the script
> returns a value (almost any value, as far as I can tell), then
> changed properties will persist. However, if the script's final
> operation doesn't return a value, it's a rather different story.
>
> If I'm right, then there's an obvious workaround (simply get the
> affected scripts to return a dummy final value). However, since this
> seems to be a bug, I wondered if any of you guys could shed a little
> more light on it - namely:
>
> 1) Has this behaviour already been identified/reported (to your
> knowledge)?
>
> 2) If not, can you replicate it on your machine (or is it just mine
> that's gone gaga)?
>
> To demonstrate the problem, I've distilled it down to the following
> snippet:
>
> --------------
>
> property n : 1
> display dialog "Test #" & n
> set n to n + 1
> if n < 4 then n
>
> --------------
>
> This should be saved as a compiled script and then run more than 3
> times from the Script Menu. The first 3 runs are successful here,
> incrementing the value of the property (n) each time. After that, the
> dialog sticks on "Test #3" (since, from the third run, the
> conditional statement returns no value).
>
> For the record, I'm testing in OS 10.4.2 / AS1.10 (system upgrade,
> not clean install).
>
> Thanks for any insight you might be able to offer...
>
> ---
> kai
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Applescript-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> 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:
This email sent to email@hidden