Compare AI file name to Folder Name (Job)

Post Reply
User avatar
larissas
Newbie
Posts: 6
Joined: Fri Aug 13, 2021 10:02 pm
Location: Wisconsin

Compare AI file name to Folder Name (Job)

Post by larissas »

I'm trying to setup a Condition with Variables that checks to see if the folder name matches the AI file name within. This is being setup on a connection to route the files one way if it does and another way (that involves delays) if it doesn't. If the files are supplied correctly, there's no reason to waste time sending them through that other part of the workflow.

It was suggested to me to use Job.NestedName, and select Before .ai. However, that result includes ALL the semicolons that separate each file. Adding After ; results in ONLY the semicolons. I've tried using a RegExp “[^;]*[A-Za-z?0-9?\s?]{1,}\.ai” but the "not" function isn't working as I expected. Does anyone know how to ignore those semicolons?
Attachments
semicolons.png
semicolons.png (158.51 KiB) Viewed 6408 times
~Larissa
freddyp
Advanced member
Posts: 1009
Joined: Thu Feb 09, 2012 3:53 pm

Re: Compare AI file name to Folder Name (Job)

Post by freddyp »

[Job.NestedName] - Contains - [Job.Name].ai
User avatar
larissas
Newbie
Posts: 6
Joined: Fri Aug 13, 2021 10:02 pm
Location: Wisconsin

Re: Compare AI file name to Folder Name (Job)

Post by larissas »

This will work for an InDesign file/package! Thanks!

However, this doesn't quite work for an Illustrator package because, when saved the way Illustrator automatically does it, the folder name also has "_Folder" at the end. How can I incorporate that?

To be clear, the folder name would be:
Brownie_Wrapper_1oz_Folder

Whereas the .ai file inside would be:
Brownie_Wrapper_1oz.ai

The way this is configured, if I'm understanding it correctly, would result in a match only if the .ai file was called:
Brownie_Wrapper_1oz_Folder.ai
But that's not what AI does by default when creating a package.

I need to be able to isolate a specific nested name without the extension so I can add the "_Folder" to the comparison.
~Larissa
freddyp
Advanced member
Posts: 1009
Joined: Thu Feb 09, 2012 3:53 pm

Re: Compare AI file name to Folder Name (Job)

Post by freddyp »

There are two possible approaches: rename the job folder first by removing _Folder, or in the condition you define the right-hand variable as:
[Job.NameProper:Before="_Folder"].ai
User avatar
larissas
Newbie
Posts: 6
Joined: Fri Aug 13, 2021 10:02 pm
Location: Wisconsin

Re: Compare AI file name to Folder Name (Job)

Post by larissas »

EDIT: So, I tried this and it seems like it should work, but it's not. It's putting any folder with a .ai in that route. I don't want to do the option of renaming anything because the whole point of this router is to avoid messing with a package that has been supplied correctly. If the customer did what they were supposed to do, I want it to just make a pdf and go to the preflight. Otherwise, it goes through a series of other actions to make it right, but that takes time.

[Job.NestedName] Contains [Job.NameProper:Before="_Folder"].ai

I also tried it setting the space to "norm," just in case that was throwing it off.
I tried switching the "Contains" to other things and none of them give the correct result.
~Larissa
User avatar
larissas
Newbie
Posts: 6
Joined: Fri Aug 13, 2021 10:02 pm
Location: Wisconsin

Re: Compare AI file name to Folder Name (Job)

Post by larissas »

Nevermind, I added another condition and it's all working now!
~Larissa
Post Reply