copy result to excel

Hi
This gets me the data I want in the results window of the script

tell application "Safari"
	get text of document 1
end tell

How do I get this data into excel so I can use it?
thanks
bills

Hi Bills,

this should work:


tell application "Safari"
	set the clipboard to (get text of document 1)
end tell

tell application "Microsoft Excel"
	set screen updating to false
	make new workbook
	tell active sheet of active workbook
		paste worksheet destination range "A1"
	end tell
	set screen updating to true
	activate
end tell

Rebewslin

Hi
Thanks Rebewslin, it works like a charm.
I noticed this will paste everything to col “a”, Doing it manualy will use col"a" to “g”.
curious as to why?
But it is a minor adjustment to the rest of the script.
Thanks again
bills

Here it is the same to paste it with the script or manually. Of course if you manually select another address than “A1” before pasting from the clipboard the result is different. In my opinion it should be the same because the script does the same things as the user would do …

Rebewslin

Hi
Rebewslin wrote

You would think so,
manual copy: data is in range “a254:g254”
script copy: data is in range “a271:a278”
both are pasted to “a1”
there has to be a logical explanation?
regards
bills