How to control a indesing file in a flow

Post Reply
ash-20
Newbie
Posts: 5
Joined: Sat Aug 26, 2023 5:00 pm

How to control a indesing file in a flow

Post by ash-20 »

Hi Guys, I'm new to the switch environment kindly help me through this task.

I have a script that converts an Excel file to JSON and a separate script that reads the JSON and copies that content to the InDesign file.

JSON Looks:

[
{
"FileName": "A",
"layer_1": "1234",
"layer_2": "ABCD"
},
{
"FileName": "B",
"layer_1": "1234",
"layer_2": "abcd"
}
]

An InDesign File will behave like a template and Loop( copy the JSON contents and save a copy with the File name)

How I can replicate the same flow in the InDesing Configurator in Switch?

Thank you
AG
jan_suhr
Advanced member
Posts: 592
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: How to control a indesing file in a flow

Post by jan_suhr »

Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
ash-20
Newbie
Posts: 5
Joined: Sat Aug 26, 2023 5:00 pm

Re: How to control a indesing file in a flow

Post by ash-20 »

jan_suhr wrote: Fri Sep 01, 2023 4:32 pm Check this:

https://www.enfocus.com/manuals/UserGui ... tions.html
hy I have gone through the document. What about the save option? because I need to update the next content from the JSON file in the same InDesign file and save it as a different file name.
jan_suhr
Advanced member
Posts: 592
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: How to control a indesing file in a flow

Post by jan_suhr »

You have the options in the InDesign elements properties
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
ash-20
Newbie
Posts: 5
Joined: Sat Aug 26, 2023 5:00 pm

Re: How to control a indesing file in a flow

Post by ash-20 »

jan_suhr wrote: Fri Sep 01, 2023 5:08 pm You have the options in the InDesign elements properties

InDesign elements properties, are you saying this PFA

If yes. I have a doubt. Now If I open (Script) a document and keep it as activeDocument (consider 123_XXX_v1.indd) add all my required info copied into the InDesign from the command option (Script), and save the file in the save option. Now how I can retain the "123_XXX_v1.indd" or keep the file inside the flow?
Attachments
Screenshot 2023-09-01 at 9.17.32 PM.png
Screenshot 2023-09-01 at 9.17.32 PM.png (151.22 KiB) Viewed 14497 times
jan_suhr
Advanced member
Posts: 592
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: How to control a indesing file in a flow

Post by jan_suhr »

In one folder before the InDesign element you add one folder besides the InDesign elemet and drag a connection to the new folder and you will get a copy of the file in that folder.
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
ash-20
Newbie
Posts: 5
Joined: Sat Aug 26, 2023 5:00 pm

Re: How to control a indesing file in a flow

Post by ash-20 »

jan_suhr wrote: Fri Sep 01, 2023 6:05 pm In one folder before the InDesign element you add one folder besides the InDesign element and drag a connection to the new folder and you will get a copy of the file in that folder.

What you said is for keeping a copy of the original file in the flow (PFA, am I correct?). But I have a JSON condition that loops for a single activeDocument! suggest me on this case
Attachments
Screenshot 2023-09-01 at 9.58.37 PM.png
Screenshot 2023-09-01 at 9.58.37 PM.png (93 KiB) Viewed 14493 times
jan_suhr
Advanced member
Posts: 592
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: How to control a indesing file in a flow

Post by jan_suhr »

Easiest solution is to split the JSON into each part for each file. Then that JSON file runs the InDesign document.
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
ash-20
Newbie
Posts: 5
Joined: Sat Aug 26, 2023 5:00 pm

Re: How to control a indesing file in a flow

Post by ash-20 »

jan_suhr wrote: Fri Sep 01, 2023 6:35 pm Easiest solution is to split the JSON into each part for each file. Then that JSON file runs the InDesign document.
hy That's a nice workaround, but I don't want to make any changes to the existing script so I going to try this way.

Initially, I will do the saveACopy for the .indd file with loop data in an outside folder (Foldername: Original output) using the Command Option and then a dummy save to move the .indd file to the out connection (save option)

And going to add a folder config and select a folder that is (Original output) using the Choose the folder option and add my files back to flow with my desired output format.

What am thinking will work?
jan_suhr
Advanced member
Posts: 592
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: How to control a indesing file in a flow

Post by jan_suhr »

It's not a workaround, that's how Switch works with metadata.
Switch can only read and use one set of values from an XML or JSON file.

If you have the Scripting module you can make a script that splits the data file and send each part to the InDesign element and it will create a new document from a template.

Next question is why don't you work with PDF-files, I suppose that is the final output. For PDF there are a bunch of tools that can solve this for you.
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
Post Reply