'現在アクティブなタブのタイトルとURLをClipBoardにコピーする。

Option Explicit

Dim luna
Dim tutext,oclip,document,dcid,cltext,deftitle

Sub fin
	Set oclip = Nothing
	Set document = Nothing
	Set luna = Nothing
	WScript.Quit
End sub

Set luna = CreateObject("Lunascape2.LunascapeAPI")
dcid = luna.GetDocumentID(luna.ActiveIndex())
Set document = luna.GetDocumentObject(dcid)

	If document Is Nothing Then
		Call luna.MessageBox("无法生成文档对象")
		fin
	End If

	On Error Resume Next
	deftitle = document.title
	If deftitle = "" Then deftitle = "notitle"
	tutext =tutext & deftitle & " : " & luna.URL
	If Err.Number <> 0 Then fin

	Set oclip = document.parentWindow.clipboardData
	cltext = oclip.getData("text")
	cltext = tutext
	oclip.setData "text",cltext

fin
