Script complexity....
Script complexity....
- Subject: Script complexity....
- From: Mike Rowland <email@hidden>
- Date: Thu, 02 Jan 2003 11:25:50 -0700
Nelson,
Often times it is preferable to write what you are asking to a variable and
then call the variable in succeeding commands...
tell application "Microsoft Excel"
get Values of Series 1 of Chart 1 -- of workbook 1, if necessary
end tell
I would modify to the following:
Tell application "Microsoft Excel"
Set someValue to (get Values of series 1 of chart 1 of workbook 1) --I think
you are trying to generate a list here so use as list at the end.
End tell
From here, you can then use the variable anywhere else in the script
(particularly in handler routines).
Hope this helps....
>
>
>
> I have another puzzler for you, if you please. Is there a level of
>
> complexity that AppleScript can't handle?
>
>
>
> It seems to me that I often have better luck breaking scripts down into
>
> tiny morsels than writing one big line. Here's an example. If I write:
>
> tell application "Microsoft Excel"
>
> tell Chart 1
>
> tell Series 1
>
> tell its Values
>
> get item 1
>
> end tell
>
> end tell
>
> end tell
>
> end tell
>
> I get the error message
>
> "Microsoft Excel got an error: Can't get item 1 of Values of Series 1
>
> of Chart 1.
>
>
>
> But if I write (what should be the same thing):
>
> tell application "Microsoft Excel"
>
> tell Chart 1
>
> tell Series 1
>
> get Values
>
> get item 1 of the result
>
> end tell
>
> end tell
>
> end tell
>
> I have success!
>
>
>
> So, wizards, how complex can I get before I have to start using "the
>
> result?"
--
Mike Rowland
Manager, Systems, Quality and Imaging
Cabelas Catalog
Cabelas Wholesale, Inc.
1 Cabela Drive
Sidney. NE 69160
308-254-6694
308-254-6669 fax
308-249-6039 PCS
_______________________________________________
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.