Re: varibles in handler
Re: varibles in handler
- Subject: Re: varibles in handler
- From: "Stockly, Ed" <email@hidden>
- Date: Mon, 17 Jan 2011 19:59:29 -0600
- Acceptlanguage: en-US
- Thread-topic: varibles in handler
> I guess in hind sight I was trying to use the same handler to set and reset
the AppleScript's text item delimiters. Looks like the handler boils down to one
line. in other words the handler is Not useful.
That does not make a handler not useful. Particularly if it's called
frequently.
It is possible to set and reset delimiters with something like this:
-----------
Set newDelimiter to {", "}
Set {applescript's text item delimiters, oldDelimiters} to {newDelimiter,
applescript's text item delimiters}
--do your stuff here
Set applescript's text item delimiters to oldDelimiters
-----------
You could pop that into a handler, make oldDelimiters a global or property
and change your delimiters with a very simple handler call:
-----------
global oldDelimiter
set newDelimiter to {", "}
my SetAndSaveTids(newDelimiter)
--->do your stuff
my SetTids(oldDelimiters)
on SetAndSaveTids(newDelimiter)
global oldDelimiters
set {AppleScript's text item delimiters, oldDelimiters} to
{newDelimiter, AppleScript's text item delimiters}
end SetAndSaveTids
on SetTids(newDelimiter)
global oldDelimiters
set AppleScript's text item delimiters to newDelimiter
end SetTids
-----------
HTH,
ES
_______________________________________________
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