Indesign Line numbering (paragraphs)

Good Day!

Guys please help, I’m trying to create a script that will place my text file with number 1- 2000

ex. of text file:
1
2
3
4
5
6
7
---- and so on

to a number of pages in indesign (let take an example of 4 pages)

I have started a script like this:


--CHOOSE A TEXT FILE
set theTextFile to ((choose file of type {"TEXT"} with prompt "locate a TEXT file to place") as string)

tell application "Adobe InDesign CS2"
	activate
	set myDoc to active document
	tell myDoc
		--SET THE UNIT OF MEASURE
		set the properties of view preferences to {horizontal measurement units:points, vertical measurement units:points, ruler origin:page origin}
		
		tell page 1
				set myTargetFrame to make new text frame with properties {geometric bounds:{36, 36, 806, 90}, contents:"blank"}
			place theTextFile on myTargetFrame
		end tell	
		
	end tell
end tell

I’m quite stuck… what happens to this script creates a frame in page 1 with the imported text file but I wanted to happen is to flow that remaining text (in the text file) up to the end of the page in indesign (which is up to page 4)

Please help.

Thanks in advance

Model: iMac g3 candy blue
AppleScript: 1.10.7
Browser: Safari 419.3
Operating System: Mac OS X (10.4)

up plz.

HI

I worked out of a textdit file for the text file and this worked for me.
just a different number on each line(paragraph).
let me know!!

--CHOOSE A TEXT FILE IN TEXTEDIT
tell application "TextEdit"
	launch
	set t to (choose file)
	open t
	set allnumbers to count every paragraph of document 1
	repeat with i from 1 to allnumbers
		set g to paragraph i of document 1
		tell application "Adobe InDesign CS2"
			tell document 1
				set the properties of view preferences to {horizontal measurement units:points, vertical measurement units:points, ruler origin:page origin}
				tell page i
					set myTargetFrame to make new text frame with properties {geometric bounds:{36, 36, 806, 90}, contents:g}
				end tell
			end tell
		end tell
	end repeat
end tell

Hi!

This was a great script thank you. This script counts the paragraphs then create a frame to each page. What I’m trying to achieive is with all the numbers in the text file this will line up continously to the next page.

To be describe better:

  1. there is a text file with numbers 1-2000 as formatted like this

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 and so on

The script will get this text file cut the data… then go to Indesign CS2 create a frame paste data in the created frame… if there are four pages… it will continously create another text box on page 2 (with the countinous text on the first frame in page 1) up to page 4 (which i think will not take up to 2000).

As this appear as line numbers as I layout a file in Indesign… and create a PDF… If ever my work is read/reviewed by a proofreader he/she will indicate what nearest number i should edit… For example proofreader said I need to change the word “Macscripter is the Bist” on page 2 … instead he/she will indicate that on “line 55 on Page 2” Bist should be “Best”

Let me know how can I help futher

Hi

I think this maybe what your after!
I’ve created a 4 page indesign doc plus i have a text file with say 500 numbers on,
when its run it fills up the first page with numbers maybe upto about 200 depending on indesign document size when it gets to the bottom of the page it moves on to page 2 then does the same but starts at 201 etc…

--CHOOSE A TEXTEDIT FILE
set theTextFile to (choose file)

tell application "Adobe InDesign CS2"
	activate
	set myDoc to active document
	tell myDoc
		--SET THE UNIT OF MEASURE
		set the properties of view preferences to {horizontal measurement units:points, vertical measurement units:points, ruler origin:page origin}
		tell page 1
			place theTextFile with autoflowing
		end tell
	end tell
end tell

Let me know!

Pidge1… this is right! thank you for you time checking out my script… “autoflowing” is the key… silly me :slight_smile:

Anyway, since you were checking out indesign, does indesign have functions to add line numbering rather than use applescript?

Again thank you.