• 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: property in script object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: property in script object


  • Subject: Re: property in script object
  • From: Tommy Bollman <email@hidden>
  • Date: Tue, 29 Jun 2010 13:41:36 +0200

First!

Yes Yvan KOENIG, it is, because in the second example the property is declared within a handler, and aren't as such : persistant. ( It won't get saved to disk).
The first example, stores the property to disk, as long as your script returns a value. -A trick to avoid would be to have the script return with just the
return statement without any value.

On 29. juni 2010, at 12.31, KOENIG Yvan wrote:

> Hello
>
> Here is a behaviour which surprised me.
>
> If I run this script :
>
> --{code}
> property howto : missing value
>
> repeat 2 times
> 	my testeur()
> end repeat
>
> on testeur()
> 	script o
> 		log "howto 1 = " & howto
> 		if howto is missing value then
> 			set howto to "is defined"
> 		end if
> 		log "howto 2 = " & howto
> 	end script
> 	run o
> end testeur
> --{code}
>
> log :
> (*howto 1 = missing value*)
> (*howto 2 = is defined*)
> (*howto 1 = is defined*)
> (*howto 2 = is defined*)
>
> On pass 2, the property howto contains  "is defined"
> which is logical because properties are supposed to be persistant.
>
> If I run :
>
> --{code}
> repeat 2 times
> 	my testeur()
> end repeat
>
> on testeur()
> 	script o
> 		property howto : missing value
> 		log "howto 1 = " & howto
> 		if howto is missing value then
> 			set howto to "is defined"
> 		end if
> 		log "howto 2 = " & howto
> 	end script
> 	run o
> end testeur
> --{code}
>
> log
> (*howto 1 = missing value*)
> (*howto 2 = is defined*)
> (*howto 1 = missing value*)
> (*howto 2 = is defined*)
>
> On pass 2, the property howto contains missing value.
> So, in the script object, the property isn't persistant.
>
> Is it the normal behaviour ?
>
> Yvan KOENIG (VALLAURIS, France) mardi 29 juin 2010 12:30:51
>
>
>
> _______________________________________________
> 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
>

Best regards



Tommy Bollman
--------------------------------------------------------------------------------------------------
Mollison's Bureaucracy Hypothesis:
	If an idea can survive a bureaucratic review
	and be implemented it wasn't worth doing.

 _______________________________________________
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

References: 
 >property in script object (From: KOENIG Yvan <email@hidden>)

  • Prev by Date: Re: property in script object
  • Next by Date: Re: Script Editor vs. Applet
  • Previous by thread: Re: property in script object
  • Next by thread: controlling volume levels
  • Index(es):
    • Date
    • Thread