Re: Paths from my Mac, hidden, compiled into my script?
Re: Paths from my Mac, hidden, compiled into my script?
- Subject: Re: Paths from my Mac, hidden, compiled into my script?
- From: Nigel Garvey <email@hidden>
- Date: Tue, 26 Nov 2013 11:02:16 +0000
Håvard Graudo wrote on Tue, 26 Nov 2013 08:03:00 +0100:
>> My understanding is that your script saved some global values.
>> Try to encapsulate it in a on Run … end run block.
>> If it uses explicit globals or properties, clean them before quitting
the
>>script.
>You will have to clean them EVEN if they are not properties or
explicitly
>declared globals. I am still on OS 10.6, but all of the above has always
>stored their values across runs.
>
>If I run the blow TWICE, the dialog will tell my secret from the previos
>run:
>
>---
>on run
> try
> display dialog "your secret is: " & mysecret --> should always fail,
>right?
> end try
> set mysecret to text returned of (display dialog "What is your secret?"
>default answer "")
>end run
>---
The explanation is that run handler variables are persistent too.
Variables are only non-persistent if they're local to an ordinary
handler, or if they're explicitly declared local in a run handler.
NG
NG
_______________________________________________
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