I need a good idea.
I would like to be able to select all spot colors, which are listed in a text-file.
This way a customer can add colors to the text-file and the action list in the Switch flow will dynamically remapped these spot colors to one spot color.
But in Pitstop Pro I can not make the list of names to a variable.
Does anybody have a good idea on how to do this?
Select spot colors based on a text file
- JimmyHartington
- Advanced member
- Posts: 310
- Joined: Tue Mar 22, 2011 7:38 am
Re: Select spot colors based on a text file
If they can save it to an Excel file you can use this app to solve it:
https://www.enfocus.com/en/appstore/pro ... 2variables
https://www.enfocus.com/en/appstore/pro ... 2variables
- JimmyHartington
- Advanced member
- Posts: 310
- Joined: Tue Mar 22, 2011 7:38 am
Re: Select spot colors based on a text file
Hi Jan
Thanks for the answer.
The problem is not to get the list to a variabel in Switch.
But more that Select Spot Color does not support to put use a Pitstop variabel as the list.
Thanks for the answer.
The problem is not to get the list to a variabel in Switch.
But more that Select Spot Color does not support to put use a Pitstop variabel as the list.
- magnussandstrom
- Advanced member
- Posts: 365
- Joined: Thu Jul 30, 2020 6:34 pm
- Location: Sweden
- Contact:
Re: Select spot colors based on a text file
Could you use "remap spot color" instead of "rename spot color" and loop the action list in switch until all new colors are converted?
Re: Select spot colors based on a text file
Hi Jimmy,
You can use RegEx instead of List and pass it as variable. Wouldn't that work for you?
(spot|spot2|spot3)
Loic Aigon
You can use RegEx instead of List and pass it as variable. Wouldn't that work for you?
(spot|spot2|spot3)
Loic Aigon
- JimmyHartington
- Advanced member
- Posts: 310
- Joined: Tue Mar 22, 2011 7:38 am
Re: Select spot colors based on a text file
I will try the regex method and report back
- JimmyHartington
- Advanced member
- Posts: 310
- Joined: Tue Mar 22, 2011 7:38 am
Re: Select spot colors based on a text file
It works using RegEx.
So I have made a script, which reads a text-file with a list of the spot colors separated by a newline.
It is manipulated into the format "(spot1|spot2|spot3)" and set on the job as Private Data.
And the Private Data is then used in the Pitstop Variable used for selecting the spot color.
Here is the code in my script:
So I have made a script, which reads a text-file with a list of the spot colors separated by a newline.
It is manipulated into the format "(spot1|spot2|spot3)" and set on the job as Private Data.
And the Private Data is then used in the Pitstop Variable used for selecting the spot color.
Here is the code in my script:
Code: Select all
import * as fs from "fs";
async function jobArrived(s: Switch, flowElement: FlowElement, job: Job) {
let PDKey: string = await flowElement.getPropertyStringValue("PDKey") as string;
let file: string = await flowElement.getPropertyStringValue("FileWithColors") as string;
let inputColors = await fs.readFileSync(file, "utf-8");
let regEx = await inputColors.split(/\r?\n/).join("|") as string;
await job.setPrivateData(PDKey, "(" + regEx + ")");
await job.sendToData(Connection.Level.Success);
}