• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Script for TextFrames

New Here ,
Nov 02, 2024 Nov 02, 2024

Copy link to clipboard

Copied

I have a template file that contains 5 pages. There are text frames on each page. The first page - the first text frame is for the TITLE. The rest of the text frames I would call them NOTATION text frames that are linked.

My problem is as follows:

  1. I need a script when I type with my font in NOTATION text frames - so that the script makes new text frames under the NOTATION text frames.

 

I'm going to call this group of new text frames LYRICS text frames.

 

The problem is that I want the syllables in the text frames LYRICS to be exactly below each character that will be in the text frames NOTATION And to be centered under each character to which they belong from text frames NOTATION

 

For now, I'm doing this job manually and that job consumes so much time.

 

I tried already with ChatGPT but without solution.

 

2 I had the idea that when I write in first row signs for notation, the script will make for each sign a separate text frame so later the script can make new text frames under those separate text frames with preferences Center aligned, etc.

 

Also with ChatGPT, I get a script which one reads data from my template file and writes that data in a .json file

 

I'm putting all the files here so anyone who can help I will be happy to resolve this headache

TOPICS
Scripting

Views

356

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 02, 2024 Nov 02, 2024

Copy link to clipboard

Copied

You just need to duplicate your "top" TextFrame, move the duplicate below with desired gap, set desired height, apply ParaStyle with align = Center. 

 

Now sure why do you need JSON export / part? 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 02, 2024 Nov 02, 2024

Copy link to clipboard

Copied

OK, I've checked your INDD file - can you post a real example?

 

Anyway, script would have to work a bit differently - it would have to go through all glyphs, check InsertionPoint before and after, calculate width of the glyph, then create new TextFrame with that width, below the original glyph.

 

Do you have your Lyrics somehow "linked" with the Notations - so script could build your document automatically?

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 02, 2024 Nov 02, 2024

Copy link to clipboard

Copied

I alredy uploaded image of real example. On that image always in first rows are GLYPHS - notation and in second rows are LYRICS.

So.. if I have in first row CHARACTER - GLYPH in second row i need text boxes under each glyph

 

GLYPH 1     GLYPH 2    GLYPH 3   GLYPH 4    GLYPH 5   GLYPH 6   GLYPH 7

      e                xa             mple           ple              of               ly              rics

 

If I only copy/paste text frame i will not have so much options for lyrics (syllables)

to put them exactly in center of each glyph behind... so like I said im doing that manualy with space bar

or with option BAR in InDesign

 

That is reason why I need script which one convert first textframes (after writeing GLYPHS) into several text frames in one row - exactly same number of textframes how many I have glyphs in that row and after that script if its possible to make second row of text frames right under thet text frames with glyphs with same size, and that second row LYRICS text frames must be conected and in script have specification (text in center) and with writeing i will not have clicking with mouse so much here and there......

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 02, 2024 Nov 02, 2024

Copy link to clipboard

Copied

By "real example" I meant with "real text" - not bunch of empty TFs. 

 

Yes, it's easy and perfectly doable - but I'm not JS guy and I'm on my phone so can't give you working code, sorry. 

 

I would even go a bit further - and anchor lyric TFs to glyphs - so in case it shifts - script would've to just slightly reposition anchored TFs instead. 

Otherwise you would've to type all lyrics again... 

 

Any chance you can have your glyphs and lyrics together, in some kind of a database? 

 

"glyph", "lyric" 

"glyph", "lyric" 

... 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 02, 2024 Nov 02, 2024

Copy link to clipboard

Copied

No I don't have any system for linking lyrics syllables with Notation, First I'm writeing notation and after that i'm writeing lyrics

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 02, 2024 Nov 02, 2024

Copy link to clipboard

Copied

OK, but can't you do that before going into InDesign? 

 

Do it in a Notepad or Excel or anything? 

 

"glyph", "lyric" 

"glyph", "lyric" 

...

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 02, 2024 Nov 02, 2024

Copy link to clipboard

Copied

So, you telling me that - first I can write Notation and Lyrics in Excell  and somehow making script which one use data from EXCELL and put that data into InDesign file all together and it can be all in order etc..

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 02, 2024 Nov 02, 2024

Copy link to clipboard

Copied

quote

So, you telling me that - first I can write Notation and Lyrics in Excell  and somehow making script which one use data from EXCELL and put that data into InDesign file all together and it can be all in order etc..


By @VITOMIRIMOTIV

 

Yes, precisely. 

 

In essence - you've pairs of glyph+lyric - and some extras that can also be handled. 

 

All those pairs can be imported to your document in sequence - glyph placed in the "main story" and the lyric anchored in the TextFrame. 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 02, 2024 Nov 02, 2024

Copy link to clipboard

Copied

Can you post sample INDD file - you've used to make screenshot? 

 

I should be able to extract an example database. 

 

Just this one page - for testing. 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 02, 2024 Nov 02, 2024

Copy link to clipboard

Copied

@VITOMIRIMOTIV

 

If you've some old files made the way you describe - I can export a few of them for you for free - in exchange for letting me make a video how it's done.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 02, 2024 Nov 02, 2024

Copy link to clipboard

Copied

LATEST

A bit similar to what you need - in terms of exporting contents of the old files: 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines