Re: how to empty clipboard contents?
Re: how to empty clipboard contents?
- Subject: Re: how to empty clipboard contents?
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 22 Mar 2004 15:21:58 -0800
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?
>
> OpenText "Jaguar:Users:mbovee:Documents:Science:ThrRS Data:Stopped
>
> flow:040319:03195052.TXT"
>
>
This part:
>
>
> Select Range "R12C1:R2513C2"
>
> CopyObject Selection
>
> Activate Window "FILENAME.xls"
>
> Paste
>
>
...should be replaceable with something which transfers the range
>
contents directly to the destination sheet. If you can't find a VBA
>
command with the functionality of the XLM COPY() command, then 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"
>
> Select Range "R1C2"
>
> set ActiveCell to "file_x"
>
> Select Range "R1C3"
You need to set the Value, not the Cell itself. And don't need to keep
selecting and setting ActiveCell:
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?
>
> end tell
--
Paul Berkowitz
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.