Re: Why save text item delimiters? Philosophical question....
Re: Why save text item delimiters? Philosophical question....
- Subject: Re: Why save text item delimiters? Philosophical question....
- From: John Delacour <email@hidden>
- Date: Sat, 21 Jun 2003 12:54:02 +0100
- Mac-eudora-version: 6.0a23
At 8:30 pm -0700 19/6/03, matt neuburg wrote:
The phrase "AppleScript's" is not a misnomer provided you know what
"AppleScript" is - it is that instantiation of the AppleScript script
scripting component.
Notwithstanding your ad hoc definition, I say that "Applescript's" or
"of Applescript" is a misnomer because most people think they know
that Applescript is a scripting language or a scripting component (or
both) and have rightly thought so from the beginning.
That instantiation maintains state, but that state is private to
this instance, and the instance will die when the current
application releases it (e.g. quits).
e.g. quits or what else?
If I launch the stay open applet below, it will have no effect on the
value of test item delimiters in Script Editor at any point. Any
experienced scripter will know this and not be surprised ...
tell application "Script Editor"
set AppleScript's text item delimiters to "ooooo"
end tell
on idle
tell application "Script Editor"
set AppleScript's text item delimiters to "ooooo"
return 5
end tell
end idle
If instead of 'Applescript's' I use 'my' (which is less misleading)
the (non-)effect will be the same, whereas if in one script running
in Script Editor I set 'my text item delimiters' to x, which might be
expected to localize the value to the script, the value is applied
globally to scripts run in the current session of Script Editor.
Here again, no one who knows will be surprised, but anyone
approaching the language with no arms but a sound sense of logic
might be, and Applescript was not devised for people who want to hear
words like instantiation.
At 4:05 pm -0700 17/6/03, matt neuburg wrote:
What you did in the first script affects what happens in the
second, because this is a global property belonging to AppleScript,
meaning the Script Editor's current instance of the AppleScript
scripting component.
Unless, of course, it is _not_ a global property:
global pi
set my pi to "3.14159"
script pi_
property pi : 6.3
set my pi to 6.3
display dialog my pi
end script
tell pi_ to run
display dialog my pi
No one's disputing the facts; it's the syntax and the perception that
are in question.
-- JD
.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.