マージされたドキュメントを正しい場所にエクスポートするために、タブ区切りのテキスト ファイルからデータを読み取る方法を知る必要があります。
-- 常に 4 番目のタブになります 2 行目 (グループ番号) ディレクトリはグループ番号で名前が付けられます
-- 以前の .vbs スクリプトによって既に作成されたディレクトリがある
データを配置する必要があります。
app.open(File(dirPath + "Card~" + (group number) + ".indd"));
また:
fileName = (group number) + " " + myPageName + " " + date + ".pdf";
myFilePath = dirPath + docType + "/" + fileName;
myFile = new File(myFilePath);
myDocument.exportFile(ExportFormat.pdfType, myFile, false);
このデータ ファイルを操作する以前の .vbs スクリプト内では、次のように記述されていました。
Call TwoDimensionArrayTest
Sub TwoDimensionArrayTest
Dim fso
Dim oFile
Dim arrline
Dim arrItem
Dim i
Dim arrMain()
Dim sFileLocation, strResults
Dim filesys, folder, path
Const forReading = 1
strFolder = "P:\RxCut\In Design Implementation\build\Co-Brand\"
mkdir = "P:\RxCut\In Design Implementation\"
Set objFSO = CreateObject("Scripting.FileSystemObject")
For Each objFile In objFSO.GetFolder(strFolder).Files
If Right(LCase(objFile.Name), 4) = LCase(".txt") Then
' The file contains on each line:
' Text1 (tab) Text2 (tab) Text3 (tab) Text4
' Text5 (tab) Text6 (tab) Text7 (tab) Text8
'etc etc
Set fso = CreateObject("Scripting.FileSystemObject")
sFileLocation = objFile.Name
Set oFile = fso.OpenTextFile(objFile.Name, forReading, False)
Do While oFile.AtEndOfStream <> True
strResults = oFile.ReadAll
Loop
' Close the file
oFile.Close
' Release the object from memory
Set oFile = Nothing
' Return the contents of the file if not Empty
If Trim(strResults) <> "" Then
' Create an Array of the Text File
arrline = Split(strResults, vbNewLine)
End If
For i = 0 To UBound(arrline)
If arrline(i) = "" Then
' checks for a blank line at the end of stream
Exit For
End If
ReDim Preserve arrMain(i)
arrMain(i) = Split(arrline(i), vbTab)
Next
path = arrMain(1)(3)
dir = mkdir & path
set filesys=CreateObject("Scripting.FileSystemObject")
If Not filesys.FolderExists(dir) Then
Set folder = filesys.CreateFolder(dir)
End If
dir = mkdir & path
Set folder = filesys.CreateFolder(dir & "\Web")
Set folder = filesys.CreateFolder(dir & "\Web\Web Cards")
Set folder = filesys.CreateFolder(dir & "\Web\Web Headers")
fso.MoveFile sFileLocation, arrMain(1)(3) & ".txt"
End If
Next
End Sub ' TwoDimensionArrayTest
.jsx で同様のことを達成するにはどうすればよいですか?