Thanks for help
Thanks for help
- Subject: Thanks for help
- From: Nelson Byrne <email@hidden>
- Date: Wed, 01 Jan 2003 13:29:55 -0800
In applescript-users digest, Vol 3 #1183 Paul Berkowitz cleared up much
of my confusion about telling and objects, at least he did what he
could. I now think:
An Excel chart series is an object. An object can contain Properties
and Elements. Elements are objects themselves and don't have labels.
Each Property has a unique label, but otherwise is pretty arbitrary. It
could be just about anything. It could be an object, a number, whatever
pleased its definer.
One of the properties of an Excel chart series has the label Border. By
an amazing coincidence this property is an object, an instance of the
Border object class, even though it could have had the label George. I
think this led to my confusing an element and a property.
======================
Further strangeness explained by Mr. Berkowitz:
It's OK to write
tell application "Microsoft Excel"
tell Chart 1
get Weight of Border of Series 1
end tell
end tell
but not OK to write
tell application "Microsoft Excel"
tell Chart 1
tell Series 1
get Weight of Border
end tell
end tell
end tell
Instead one writes:
tell application "Microsoft Excel"
tell Chart 1
tell Series 1
get Weight of its Border
end tell
end tell
end tell
I couldn't find its in the AppleScript Language Guide, but I did find
that I could write
get Weight of Border of it
That worked for Excel too. The Guide specifically states that if you
refer to a property in a Tell statement without using either "it",
"me", or "my", AppleScript will assume you want the default target. It
would seem to imply that using "of it" is never necessary. If you do
use "of it" you get the default target anyhow.
This brings us to "its," which is not in the Guide. It does state that
"my XX" is the same as "XX of me" and I guess that's what inspired Mr.
Berkowitz to invent the term "its," which in fact works and does the
job.
Thanks again.
Nelson Byrne
_______________________________________________
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.