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

variables vrs properties


  • Subject: variables vrs properties
  • From: Jim Brandt <email@hidden>
  • Date: Wed, 5 Jan 2011 09:10:41 -0600

What exactly are the advantages/disadvantages to using properties over variables?

Property	•	global within scope
		•	retains value until script is recompiled

Variable	•	global within scope only if declared global
		•	doesn't retain value between executions

Other than these two distinctions, is there any reason to use a property over a variable?

Along these same lines, some here have suggested I use a .plist file to set certain predefined values (I was asking specifically about a default file location for source and library files).

Why would a .plist file be advantageous over just a plain text file? Either way, if have to run code to set a variable and thus can't use properties built on that variable, which is the original intent.


I have read Luther's Property List tutorial. While it describes some of how to read and write all or part of a .plist file from Applescript, it still doesn't answer --why-- I would want to do this?


While I am an old school programmer (Fortran, Cobol and some PHP), and have a fair understanding of programming methods, I have never used Xcode or any other tools Apple provides to program my Mac other than AS and a very little Unix cmd line stuff.

I'm using 10.4.11 on a PowerPC as my main platform and thus only have Xcode 2. Luther's tutorial addresses features in the Property List Editor that showed up in Xcode 3, which requires an Intel processor. Thus I question why I need to go through the process of learning a whole new technology to create and use one file for the specific purpose of pointing scripts to a source location.

While the learning of new technology can be a good thing, it seems like a little overkill here.

Am I missing something?

Thanks for listening to my rants.

Jim _______________________________________________
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: Luther Fuller <email@hidden>
  • Prev by Date: Re: Using a library to point to source folders
  • Next by Date: Re: variables vrs properties
  • Previous by thread: Re: Find dups in list
  • Next by thread: Re: variables vrs properties
  • Index(es):
    • Date
    • Thread