• 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: list to a text representation of that list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: list to a text representation of that list


  • Subject: Re: list to a text representation of that list
  • From: yvan-koenig <email@hidden>
  • Date: Wed, 16 Mar 2005 12:36:09 +0100


Le 16 mars 2005 , à 11:55, jj a écrit :

Sure! I'll modify it. Thanks!


I did it:

whateverToText({1, "a", {x:2}}) --> "{1, \"a\", {x:2}}"

on whateverToText(x)
	try
		if class of x is in {string, Unicode text} then
			try
				count x
				return x
			on error msg --> handle data string/utxt
				return text 1 thru -39 of msg
			end try
		else
			tell application x to beep
		end if
	on error msg
		set AppleScript's text item delimiters to "application"
		set laListe to (text items of msg)
		set AppleScript's text item delimiters to ""
		set msg to text 2 thru -2 of laListe's item 2
		if msg starts with "(" and msg ends with ")" then --> unknown object
			beep 2
			return text 2 thru -2 of msg
		else
			return msg
		end if
	end try
end whateverToText

Yvan KOENIG



_______________________________________________
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


References: 
 >Re: list to a text representation of that list (From: jj <email@hidden>)

  • Prev by Date: Re: list to a text representation of that list
  • Next by Date: Pass a variable to an include file
  • Previous by thread: Re: list to a text representation of that list
  • Next by thread: Re: Applescript-users Digest, Vol 2, Issue 177
  • Index(es):
    • Date
    • Thread