• 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
ANN: String to Property Coercion subroutines released
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ANN: String to Property Coercion subroutines released


  • Subject: ANN: String to Property Coercion subroutines released
  • From: Jeff Porten <email@hidden>
  • Date: Thu, 2 Jun 2005 01:44:38 -0400

Needed this for another project I'm working on, so I built it and it's yours for the taking. Readme follows, available at <http:// www.jeffporten.com/software>.

Freeware for noncommercial use, although donations accepted. Contact me to use in commercial scripts.

addPropToString will create new properties or replace existing ones, returning a string that looks exactly like an AppleScript property statement. getPropFromString returns the value of a selected property, returning an empty string if the property does not exist.

Syntax:
addPropToString at someprop for somevalue into propstring
getPropFromString for someprop from propstring

set newPropString to addPropToString at "newproperty" for "testvalue" into ""
--> "{newproperty:\"testvalue\"}"


set newPropString to addPropToString at "newproperty2" for "newvalue" into newPropString
--> "{newproperty:\"testvalue\",newproperty2:\"newvalue\"}"


set newPropString to addPropToString at "newproperty2" for "replacevalue" into newPropString
--> "{newproperty:\"testvalue\",newproperty2:\"replacevalue\"}"


set gottenProp to getPropFromString for "newproperty" from newPropString
--> "testvalue"

Best,
Jeff
_______________________________________________
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: ANN: String to Property Coercion subroutines released
      • From: "Gary (Lists)" <email@hidden>
  • Prev by Date: OT: help with weird setting
  • Next by Date: Re: ANN: String to Property Coercion subroutines released
  • Previous by thread: OT: help with weird setting
  • Next by thread: Re: ANN: String to Property Coercion subroutines released
  • Index(es):
    • Date
    • Thread