beginner's Excel script (round2)
beginner's Excel script (round2)
- Subject: beginner's Excel script (round2)
- From: Michael Bovee <email@hidden>
- Date: Sat, 27 Mar 2004 15:18:19 -0500
Hi all,
As a complete beginner, I'm once again tired of floundering, so its
time to ask another stupid question! I previously got some great
feedback on making my first script, which happens to be for Excel, but
I quickly hit another snag.
The goal of my script is to pile into one Excel file many columns of
X,Y numerical data (for later importing into my graphing program) from
a whole bunch of text files that Excel is capable of opening directly.
I simply dont know enough yet to script everything I want to happen in
my first attempt; So I'll settle for a very whimpy script that will do
*something* to minimize the boring repetition, then improve it later.
I began by using recordability to learn how to talk to Excel, and
basically tried to make my script exactly mimic the UI steps I would
have taken to do this manually.
One tip from Paul Berkowitz was so close to a breakthrough, but it
didnt work the way I expected: Instead of telling excel to literally
copy and paste my selections, Paul tried to help me see how to set up
and transfer Excel ranges between worksheets as a variable, without
copying or pasting anything:
<snippet from one of Pau's replies>
set theRange to Value of Range "R12C1:R2513C2" of ActiveSheet -- a
set Value of Range "R1C1:R2502C2" of ActiveSheet to theRange
-- without activating: of Worksheet 1 of Workbook "FILENAME.xls"
but when I tried this in various fiddling forms, I got an error that
AppleScript could not set theRange to an "integer" (maybe I was
supposed to define this selection as a curly-braced {list}?) and I
would get two columns of zeros where the 'selection' was supposed to be
pasted in...
Maybe this would be a lot easier for me if I could make it a more
"hands on" Macintosh-like interactive thing, until I learn more
sophisticated ways. So, is it easy to implement 'prompt boxes' where
the script puts up user input dialog boxes that walk me through my
process? For example, start with 1) a box comes up that says "enter a
name for the Master Excel file you want, and I'll create the worksheet.
Box 2) select the first file you want me to get your X,Y data from,
and I'll paste it into the master list. Box 3) select the next file...
and so on.
I know this sounds juvenile, but I think its about the only thing I can
understand without having an expert sit down with me over coffee and do
some hands-on scripting. I want to get beyond my fear-of-programming
and get this menial work done in a cool and efficient way, but the
self-learner approach (with Matt Neuberg's book for reference) ain't
gettin' me there fast enough...
</end whine> ;0)
Thanks folks, for any suggestions
--Michael
_______________________________________________
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.