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

if/else combined with delimited txt file

New Here ,
May 15, 2018 May 15, 2018

Copy link to clipboard

Copied

Hi all,

I would have a quick question: I wrote a script to take informations like the page width/height and paste it into a new document and save it with the given informations.

Besides that I wanted to include in every document a text frame with the information of the aspect ratio.

I thought the easiest way would be an if/else tag to insert wether the height divided by the width or vice versa. But unfortunately InDesign is not grabbing these informations from my delimited text file.

The script would be the following: https://pastebin.com/NW9H6dxU

This would be an example of my current txt file: https://we.tl/Dlp0aEM3mA

Is there anything I need to change in order to make it work?

Thanks a lot for your help!

TOPICS
Scripting

Views

208

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 ,
May 16, 2018 May 16, 2018

Copy link to clipboard

Copied

line 3 of the script opens the text file, but it doesn't appear to be closed after this point.

make line 5 of the script as follows:

file.close();

what happens once this is done?

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
New Here ,
May 17, 2018 May 17, 2018

Copy link to clipboard

Copied

LATEST

Hi!

actually the script is going through the spreadsheet and creates new files with a specific margin per new document and saves them in a specific file name.

The only thing that is not working properly is the "if-else" statement: He doesnt take into consideration to divide the width/height, when the width is bigger than the height or vice versa. Is he probably not able to take these informations from a spreadsheet?

Thank you!

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