• 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: variables vrs properties
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: variables vrs properties


  • Subject: Re: variables vrs properties
  • From: "email@hidden" <email@hidden>
  • Date: Thu, 6 Jan 2011 07:05:08 -0800

I guess the only other distinction (although a very significant one) that I failed to mention earlier is the initial property value
is evaluated (and applied) at compile time whereas a variable isn't evaluated until run-time.

Actually, no. The initial property value is set at runtime, before the runhandler executes.

Nothing actually executes at compile time.

In this example, the first time you run the script you're asked to navigate to a file. Not when you compile, when you run.

The second time you run it the values are set and you're not asked to navigate.


ES

property getStarted : (choose file)
property pathAsText : getStarted as text
on run


display dialog getStarted as text
display dialog pathAsText


set pathAsText to "Hello"
display dialog pathAsText
end run


 _______________________________________________
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

  • Follow-Ups:
    • Re: variables vrs properties
      • From: Chris Page <email@hidden>
References: 
 >Re: variables vrs properties (From: Jim Brandt <email@hidden>)

  • Prev by Date: Re: variables vrs properties
  • Next by Date: Re: variables vrs properties
  • Previous by thread: Re: variables vrs properties
  • Next by thread: Re: variables vrs properties
  • Index(es):
    • Date
    • Thread