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

How to use the content of Datafields to determine wether a shape is on the indesign document or not.

New Here ,
Feb 17, 2020 Feb 17, 2020

Copy link to clipboard

Copied

I have a CSV file with booleans as the content. Now I want to write a JS script that looks for the boolean in a certain Datafield <<boolean>> from my data merge in inDesign and then depending on wether that boolean is 1,0 (True or False) displays a square with a black outline and no fill or a square with a blck outline and black fill.  That square's position is dependent on my design and should be possible to be determined. How do I write that script? Can you point me in the right direction? I have no idea how to access the specific Datafield <<boolean>> from the datamerge. And how would I draw a shape with js in indesign and place it where I want it corespondingly to where the Datafields would be written on my InDesign document? Thanks for reading my complex question. (at least that's what I think it is)

TOPICS
Scripting

Views

198

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 ,
Feb 19, 2020 Feb 19, 2020

Copy link to clipboard

Copied

LATEST

I wouldn't use a script, but instead I'd use GREP styles to accomplish this.

First, you would need to make a font where only the characters 1 and 0 had any appearance. You could use this script: http://www.indiscripts.com/post/2013/05/indyfont-1-1-public-pro-release-and-users-guide to do this (the free version will let you create a font with one character and you could make two fonts; OR you could help out the developers and purchase the font and do it in one font). In each case, you want to turn a square into the single character font that will be mapped to the 1 and 0 characters.

Then, you would make one paragraph style that contains two GREP styles - one that applies a black outline only whenever the GREP style looks for 0; and one that applies a black fill whenever the GREP style looks for 1.

If the answer wasn't in my post, perhaps it might be on my blog at colecandoo!

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