• 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: coercing a list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: coercing a list


  • Subject: Re: coercing a list
  • From: Ric Phillips <email@hidden>
  • Date: Thu, 30 Aug 2001 09:32:29 +1000

>>> It yields "abc" on my system. Have you been modifying text item
>>> delimiters?
>>
>> Yes, sorry, I didn't realise they stayed changed from one execution of a
>> test program to another.
>
> They're systemic within the application that invoked the change. If you
> change them in an applet, they stay changed only within that applet, and
> only until the applet quits, for example. If you change them in a script
> run from script editor, they stay changed until script editor quits, so
> running another script will use the changed TIDs.
>
> Of course, we're referring to the last change made.
>
Where ever I use TIDs I put (or load) the following script object into my
code, which makes them easier to use...less typing, one command to change
them, one command to restore, minimal error checking to catch type errors
when using a variable.

script TID

property savedTID : ""

to setTID to c with saveOld
if (class of c is string) then
if saveOld then
set savedTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to c
else
set AppleScript's text item delimiters to c
end if
else
error "setTID parameter of TID must be a string"
end if
end setTID

to restoreTID()
set AppleScript's text item delimiters to savedTID
end restoreTID

end script

Ric Phillips

Computer Laboratory Support Officer
Faculty of Humanities and Social Sciences
La Trobe University
9479 2792


  • Follow-Ups:
    • Re: coercing a list
      • From: Emmanuel <email@hidden>
References: 
 >Re: coercing a list (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: coercing a list
  • Next by Date: Re: Remote Access scripting in OS9.1
  • Previous by thread: Re: coercing a list
  • Next by thread: Re: coercing a list
  • Index(es):
    • Date
    • Thread