その他

Chromeブックマークマネージャのブックマークを展開し、フォルダ・ファイルにしてエクスポート(11/15)[No54]

スポンサーリンク

前回までお話していた、自作したプログラムの紹介を行った記事(下記リンク)の続きで、今回は11記事目になります。

no image
Chromeブックマークマネージャのブックマークを展開し、フォルダ・ファイルにしてエクスポート(10/15)[No53]
前回までお話していた、自作したプログラムの紹介を行った記事(下記リンク)の続きで、今回は10記事目になります。 長いファイルなので小分けにして書いていきますが、全て同じファイル「bk ...

長いファイルなので小分けにして書いていきますが、全て同じファイル「bkmksopen4_03.vbs」に書いて下さい。

ソースコード


Option Explicit

'***********************************************
**********
Include("D:\Application\BookmarkMakeFile\FunctionsCollection.vbs")
Sub Include(ByVal InputFilePath)
	Dim strFile
	Dim ObjFSO : Set ObjFSO = Wscript.CreateObject("Scripting.FileSystemObject")
	Dim ObjInputFile : Set ObjInputFile = ObjFSO.OpenTextFile(InputFilePath, 1, False, 0)
	ExecuteGlobal ObjInputFile.ReadAll()
	ObjInputFile.Close : Set ObjInputFile = Nothing
	Set ObjFSO = Nothing
End Sub
'*********************************************************
'------------------------------------------------------------------------
'カレントディレクトリのパスを取得する
'------------------------------------------------------------------------
Dim CurDir : CurDir = GetCurDir()
Call MyselfMsgBox01(WScript.scriptname,"001","CurDir",CurDir)
'------------------------------------------------------------------------
'◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇
'------------------------------------------------------------------------
'Inputファイルを読み込む
'------------------------------------------------------------------------
Dim inputFilePath01 : inputFilePath01 = curDir & "\" & "workfile4_02_01_k.html"
Dim strRepBefore01 : strRepBefore01 = ReadFile_ADODBStream(inputFilePath01)
Dim k : k = strRepBefore01
'------------------------------------------------------------------------
'◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇
'------------------------------------------------------------------------
'Inputファイルを読み込む
'------------------------------------------------------------------------
Dim inputFilePath02 : inputFilePath02 = curDir & "\" & "workfile4_02_02_record.html"
Dim strRepBefore02 : strRepBefore02 = ReadFile_ADODBStream(inputFilePath02)
Dim record : record = strRepBefore02
'------------------------------------------------------------------------
'◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇
'------------------------------------------------------------------------
'文字列の置換:【^(<DT><H3).*?</H3>】
'「(^(<DT><H3))~(</H3>)まで」①_フォルダ名を取得する
'------------------------------------------------------------------------
Dim sKey : sKey = "^(<DT><H3)"
Dim eKey : eKey = "</H3>"
Dim strPattern : strPattern = sKey & ".*?" & eKey

Dim Matches : Set Matches = ExtractReturnMatches(strPattern,False,record)

Dim count : count = 0
Dim m

For Each m In Matches
   If (IsEmpty(m) = False and count = 0 ) then
      k = m
      '------------------------------------------------------------------------
      '整理(少しずつ抽出したところは削除していく)
      '------------------------------------------------------------------------
      record = Mid(record,Len(m)+1)
   End If
   count = count +1
Next

Dim strRepAfter01 : strRepAfter01 = k
Dim strRepAfter02 : strRepAfter02 = record
'------------------------------------------------------------------------
'◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇
'------------------------------------------------------------------------
'outputファイルを作成する
'------------------------------------------------------------------------
Dim outputFilePath01 : outputFilePath01 = curDir & "\" & "workfile4_03_01_k.html"
Call WriteFileText_ADODBStream(outputFilePath01,strRepAfter01)
'------------------------------------------------------------------------
'◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇
'------------------------------------------------------------------------
'outputファイルを作成する
'------------------------------------------------------------------------
Dim outputFilePath02 : outputFilePath02 = curDir & "\" & "workfile4_03_02_record.html"
Call WriteFileText_ADODBStream(outputFilePath02,strRepAfter02)
'------------------------------------------------------------------------
'◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇
'------------------------------------------------------------------------
'vbsファイルを実行する
'------------------------------------------------------------------------
Dim vbsFilePath   : vbsFilePath   = curDir & "\" & "bkmksopen4_04.vbs"
Dim returnErrNo : returnErrNo =  RunVBSFile(vbsFilePath)
WScript.Quit(returnErrNo)

プログラムについて

今回の「Chromeブックマークマネージャのブックマークを展開し、フォルダ・ファイルにしてエクスポート」の内容はファイル数が多いため、下記リンクの全15記事に分けてファイルごとに紹介しています。
※この記事の続きは12記事目になります。

最後までお付き合いいただきありがとうございます!

この情報が誰かの役にたてれば幸いです。

スポンサーリンク

-その他