🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.scripting.indesign
1 messages
1 total messages Started by Archie_Tucker Fri, 23 Jan 2009 17:08
VBScript Duplicating Formatted Text From Tagged Text File
#1756
Author: Archie_Tucker
Date: Fri, 23 Jan 2009 17:08
81 lines
3275 bytes
Working on a VBscript to duplicate formatted text. Below is an example of what I have so far. The problem I have is on the next to last line, how to put the formatted text from the text frame with the placed tagged text file into the new text frame.
Thanks,
Archie

Rem CREATE TEXT FRAMES FUNCTION
Rem ---------------------------
Function myCreateFrames (myDocument)

Set myCurrentFrame = myDocument.TextFrames.Item("myOverFlowFrame")
	myCharacterCount = MyCurrentFrame.Characters.Count

Rem Get Product Code
	If myCharacterCount > 0 Then
		If left(myCurrentFrame.Texts.Item(1).Contents,9) = "[product=" Then
			myProductLabel = Mid(myCurrentFrame.Texts.Item(1).Contents,10)
			myProductLabel = Split(myProductLabel,"]")(0)' get all to "]"

			Set myLastCharacter = myCurrentFrame.Characters.Item(9 + Len(myProductLabel) + 2)
			myCurrentFrame.Texts.ItemByRange (1,myLastCharacter).Item(1).Contents=""

		End If
	End If

Rem Get Product Width
myCharacterCount = MyCurrentFrame.Characters.Count
	If myCharacterCount > 0 Then
		If left(myCurrentFrame.Texts.Item(1).Contents,6) = "[wdth=" Then
			myProductWdth = Mid(myCurrentFrame.Texts.Item(1).Contents,7)
			myProductWdth = Split(myProductWdth,"]")(0)' get all to "]"

			Set myLastCharacter = myCurrentFrame.Characters.Item(6 + Len(myProductWdth) + 2)
			myCurrentFrame.Texts.ItemByRange (1,myLastCharacter).Item(1).Contents=""

		End If
	End If

Rem Get Product Height
myCharacterCount = MyCurrentFrame.Characters.Count
	If myCharacterCount > 0 Then
		If left(myCurrentFrame.Texts.Item(1).Contents,6) = "[hght=" Then
			myProductHght = Mid(myCurrentFrame.Texts.Item(1).Contents,7)
			myProductHght = Split(myProductHght,"]")(0)' get all to "]"

			Set myLastCharacter = myCurrentFrame.Characters.Item(6 + Len(myProductHght) + 2)
			myCurrentFrame.Texts.ItemByRange (1,myLastCharacter).Item(1).Contents=""

		End If
	End If

Rem Create Product Label frame

	Set myTextFrame = myDocument.Textframes.Add

	X1=5
	Y1=5
	myTextFrame.GeometricBounds = Array(Y1, X1, 3 + Y1, myProductWdth + X1)

	myTextFrame.Contents = myProductLabel
	Set myText = myTextFrame.Texts.Item(1)

	With myText
		.AutoLeading = 100
		.BaselineShift = -3
		.FillColor = myDocument.Colors.Item("Red")
	End With

Rem Create Product Frame

	Set myCurrentFrame = myDocument.TextFrames.Item("myOverFlowFrame")
	Set myCurrentText = myCurrentFrame.Texts.Item(1)	
	Set myTextFrame = myDocument.TextFrames.Add

	X1=5
	Y1=11
	myTextFrame.GeometricBounds = Array(Y1, X1, myProductHght + Y1, myProductWdth + X1)
	myTextFrame.Label = "1"

REM Problem Line Below
* *****	myTextFrame.Texts = myCurrentText *******

End Function
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads