Re: how to empty clipboard contents?
Re: how to empty clipboard contents?
- Subject: Re: how to empty clipboard contents?
- From: Michael Bovee <email@hidden>
- Date: Mon, 22 Mar 2004 19:06:58 -0500
Thanks for the help so far! Your suggestions will really improve my
script. But before getting into that below, I still would like to know
if its possible to talk to the finder about the state of the clipboard?
Maybe not necessary for this script, but down the road.
On Monday, March 22, 2004, at 06:21 PM, Paul Berkowitz wrote:
On 3/22/04 2:47 PM, "Walter Ian Kaye" <email@hidden>
wrote:
If you are copying within Excel, you should be able to bypass the
clipboard.
I don't know VBA, but in XLM you can do
=COPY(source_range,dest_range).
tell application "Microsoft Excel"
Activate
Create New Workbook
Save ActiveWorkbook In "Jaguar:Users:mbovee:Desktop:FILENAME.xls"
That will save an empty new workbook, of course. Why not Save As after
you've imported teh text file?
Because ultimately I want a script that will copy selections from
_many_ .txt files (which can be opened directly in Excel) into one
final Excel file. I havent sorted out yet which part(s) of the process
will be "looped" so in my first attempt, I visualized a solution that
began with saving what would become the master list Excel file first,
and then having some recursive loop that opens succesive text files
from someDirectory and copy/pasting the relevant part back into the
master file...
you should be able to just 'Evaluate' the XLM (aka Excel 4.0 Macro)
command.
You don't need VBA or Evaluate: it's all in the AppelScript Dictionary.
set theRange to Value of Range "R12C1:R2513C2" of ActiveSheet -- a
list
of lists
Activate Window "FILENAME.xls" -- if you really want to
set Value of Range "R1C1:R2502C2" of ActiveSheet to theRange
-- without activating: of Worksheet 1 of Workbook "FILENAME.xls"
Select Range "R1C1"
set ActiveCell to "time_sec"
You need to set the Value, not the Cell itself. And don't need to keep
selecting and setting ActiveCell:
Yeah, I understand that there's plenty of room for streamlining, here.
Thanks for your suggestions. This partial script is the result of
literally my first few hours of programming practice. (the hardest
part is getting over feeling like the 'manual labor' way I have been
doing this until now is actually a lot faster than making this script.
It may not be more efficient in the long run, but it IS faster! I hate
learning curve investments, but they pay off eventually...Got my Ph.D.
that way, after all! :0)
set Value of Cell "R1C1" of ActiveSheet to "time_sec"
set Value of Cell "R1C2" of ActiveSheet to "file_x"
etc. (Those can even be assigned in one line as a Range:
set Value of Range "R1C1:R1C2" to {" time_sec", "file_x"}
Close Window "03195052.TXT"
Activate Window "FILENAME.xls"
-- is that necessary?
Probably not. I'm just trying to visually work through how I'll
eventually switch back and forth between each newly opened .txt file
and the Master file. Its difficult for me even to decipher some of the
examples in Matt Neuberg's book, which really jumps in assuming a _lot_
of prior programming experience, IMHO. But I'll get there.
Thanks again Paul and Walter, for sharing your insights!
--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.