• 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: get properties treating variable as literal
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: get properties treating variable as literal


  • Subject: Re: get properties treating variable as literal
  • From: Christopher Nebel <email@hidden>
  • Date: Wed, 4 Oct 2006 11:11:29 -0700

On Oct 4, 2006, at 9:45 AM, Jaime Magiera wrote:

Ok, this is an easy one. Applescript treats my variable in a "get" as a literal. I thought the lack of pipes would prevent this. However, there's something else I must be missing. I searched the archives, but he suggestion of using (| & variable & |) doesn't work either. thanks for any help.

on verifyUniqueIDs(newPreferencesArray, currentPreferencesArray, uniqueKey)

if (currentPreferencesArray is not equal to {}) then
set currentUniqueKeys to {}


-- How can I get the "get" to read the value of uniqueKey, not as a literal

repeat with aPreferenceObject in currentPreferencesArray
copy (get ( uniqueKey) of aPreferenceObject) to end of currentUniqueKeys
end repeat


	else
		set currentUniqueKeys to {}
	end if

	return currentUniqueKeys
end

You omitted the context about exactly what currentPreferencesArray and uniqueKey are, but I'm guessing from your question that they're a record and a string, respectively. Record keys are not strings and cannot be put into variables. Strings are not record keys, and cannot be used to access record values. [1] Assuming my guess was correct, the solution to your problem will vary depending on where currentPreferencesArray is coming from and how much control you have over it.



--Chris Nebel AppleScript Engineering

[1] At least, not in any obvious way. There are tricks you can use to get around this.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: get properties treating variable as literal
      • From: Jaime Magiera <email@hidden>
References: 
 >get properties treating variable as literal (From: Jaime Magiera <email@hidden>)

  • Prev by Date: Re: DateBug?
  • Next by Date: Re: Can't turn off screen savers in System Preferences
  • Previous by thread: Re: get properties treating variable as literal
  • Next by thread: Re: get properties treating variable as literal
  • Index(es):
    • Date
    • Thread