• 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
Re: Paths from my Mac, hidden, compiled into my script?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: file with most recent modification date
  • Next by Date: Re: file with most recent modification date
  • Previous by thread: Re: Paths from my Mac, hidden, compiled into my script?
  • Next by thread: Find a line break followed by a lower case character
  • Index(es):
    • Date
    • Thread