• 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: coerce record to string - does this work in other System languages?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: coerce record to string - does this work in other System languages?


  • Subject: Re: coerce record to string - does this work in other System languages?
  • From: Luther Fuller <email@hidden>
  • Date: Thu, 25 Mar 2010 17:54:42 -0500

An interesting discussion. So, I did some experimenting.
This script gets the names of the items in the record.
(But notice that the example record contains no records.)

property aRec : {a:1, b:"xyz", c:{1, 2, 3}, d:true} -- for example
try
aRec as text
on error errText
set aRecText to space & errText & space
end try
set AppleScript's text item delimiters to {"{"}
set aRecText to (text items 2 thru -1 of aRecText) as text
set AppleScript's text item delimiters to {"}"}
set aRecText to (text items 1 thru -2 of aRecText) as text
set AppleScript's text item delimiters to {":"}
set recNames to (text items of aRecText)
repeat with i from 1 to (-1 + (count items of recNames))
set itemName to (last word of item i of recNames) as text
display dialog the result as text
end repeat

The problem, now, is to get the value of a named record item.
I tried using 'run script ...', but this does not work.
Also, using 'last word of ...' probably won't work in general, but can be fixed.

 _______________________________________________
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: coerce record to string - does this work in other System languages?
      • From: "Mark J. Reed" <email@hidden>
References: 
 >coerce record to string - does this work in other System languages? (From: Skeeve <email@hidden>)

  • Prev by Date: Re: Sort folder list descending
  • Next by Date: Re: old script fails AND BUG in Smile 3.5.2 (build 609)
  • Previous by thread: Re: coerce record to string - does this work in other System languages?
  • Next by thread: Re: coerce record to string - does this work in other System languages?
  • Index(es):
    • Date
    • Thread