Using variables in filepath
Using variables in filepath
Would it be possible to use a variable as part of a filepath for a folder in Switch?
I have a fixed folder structure for all costumers. The only difference is, that the top folder would be named after the costumer. All files are submitted through a Submit Point and the name of the costumer (which equals the name of the top folder) is supplied as metadata.
I have a specific flow that will be duplicated for each costumer and at different point in this flow I use folders in that same folder structure. Let's say I have this folder structure: Name/Input/Datasource. Rather than change each flow to point to the correct folder, it would be really handy if I could define "Name" as a variable grabbed from the metadata.
I use variables for paths in "Inject Job", but the same syntax doesn't seem to work for a folder path. Any ideas?
I have a fixed folder structure for all costumers. The only difference is, that the top folder would be named after the costumer. All files are submitted through a Submit Point and the name of the costumer (which equals the name of the top folder) is supplied as metadata.
I have a specific flow that will be duplicated for each costumer and at different point in this flow I use folders in that same folder structure. Let's say I have this folder structure: Name/Input/Datasource. Rather than change each flow to point to the correct folder, it would be really handy if I could define "Name" as a variable grabbed from the metadata.
I use variables for paths in "Inject Job", but the same syntax doesn't seem to work for a folder path. Any ideas?
Re: Using variables in filepath
Sounds like set hierarchy and submit hierarchy would work for you. Within set hierarchy, you can enter variables.
Free Switch scripts: open-automation @ GitHub
Free Switch apps: open-automation @ Enfocus appstore
Want to hire me? I'm looking for my next gig. Contact me on LinkedIn or via email.
Free Switch apps: open-automation @ Enfocus appstore
Want to hire me? I'm looking for my next gig. Contact me on LinkedIn or via email.
Re: Using variables in filepath
I don't think I understand how that would help? What I want is to be able to set the path to a specific folder in my flow, by using variables.
Re: Using variables in filepath
But if you set the hierarchy and then point it to the root-folder there you want your unique folder, then you get the correct folder structure there? Or is I missing something?Terkelsen wrote:Let's say I have this folder structure: Name/Input/Datasource. Rather than change each flow to point to the correct folder, it would be really handy if I could define "Name" as a variable grabbed from the metadata.
Between jobs!
Re: Using variables in filepath
Hi,
Defining a Hierarchy seems also a good idea to me because you can have you "all the clients" folder basis and create the "per client" subfolder structure based on the metadata. Once that done, you can have another flow that would use a hierarchy entry point on the "all the clients" folder and retain the hierarchy path so you can dispatch the jobs between the appropriate flows.
Unless I misunderstand the request.
Loïc
Defining a Hierarchy seems also a good idea to me because you can have you "all the clients" folder basis and create the "per client" subfolder structure based on the metadata. Once that done, you can have another flow that would use a hierarchy entry point on the "all the clients" folder and retain the hierarchy path so you can dispatch the jobs between the appropriate flows.
Unless I misunderstand the request.
Loïc
- TheCaptain
- Member
- Posts: 86
- Joined: Mon Jan 18, 2016 4:22 pm
- Location: London
Re: Using variables in filepath
I'm wondering if he means rather than creating Folders, instead he's looking to direct traffic to specific folders that already exist but are nested within a consistent Folder Structure.
So whether the top level folder is called; Nike / Adidas / Puma, the lower levels are always named the same i.e Proof / Artwork / Data.
In this way he needs a variable to point to the lower level of a unique top level.
If this is the case, I believe hierarchy can still complete this task but you would need to specify Regular Expressions style layer arguments to pinpoint a specific item.
This https://www.cheatography.com/davechild/ ... pressions/ may help...
So whether the top level folder is called; Nike / Adidas / Puma, the lower levels are always named the same i.e Proof / Artwork / Data.
In this way he needs a variable to point to the lower level of a unique top level.
If this is the case, I believe hierarchy can still complete this task but you would need to specify Regular Expressions style layer arguments to pinpoint a specific item.
This https://www.cheatography.com/davechild/ ... pressions/ may help...
Re: Using variables in filepath
Did you ever get this to work? I believe I'm trying to accomplish the same result and just cant figure it out. When a job is received I use the metadat to rename the file and create a new job folder. At that time I want to create a set of folders in the job folder. These are the same for every job we do adn are used as the job progresses though production, preflight, proofing, hi res output, mailing, etc.Terkelsen wrote: ↑Mon Sep 19, 2016 12:14 pm Would it be possible to use a variable as part of a filepath for a folder in Switch?
I have a fixed folder structure for all costumers. The only difference is, that the top folder would be named after the costumer. All files are submitted through a Submit Point and the name of the costumer (which equals the name of the top folder) is supplied as metadata.
I have a specific flow that will be duplicated for each costumer and at different point in this flow I use folders in that same folder structure. Let's say I have this folder structure: Name/Input/Datasource. Rather than change each flow to point to the correct folder, it would be really handy if I could define "Name" as a variable grabbed from the metadata.
I use variables for paths in "Inject Job", but the same syntax doesn't seem to work for a folder path. Any ideas?
Re: Using variables in filepath
No, I still haven't found a way to use variables in the folder path.
However, I think your challenge is a bit different as you have the metadata to name the folder from. If I understand you correct, I think this can be solved by using the Inject Job element.
Create a folder containing the desired folder structure. Eg. a folder called "Topfolder" containing Folder_1, Folder_2 etc. and maybe some subfolders. Rename the incoming file using the metadata. Now use a copy of this file to trigger the injection of the folder containing the folder structure. When injecting the folder make sure to rename it after the incoming job (If that job has an extension, you will end up with a folder with an extension, which you have to remove using Rename Job).
On the original file (the one you didn't use for the injection) set the Hierarchy Path to be the Jobname Proper. Now direct both files to an Archive Hierarchy. You need to make sure that the new folder structure is in the Archiver Hierarchy before the file comes in. I suggest you simply put the file on hold for a few seconds to ensure that. There might be better ways?
It could all look something like this: As always with Switch there are probably other ways to achieve the same
However, I think your challenge is a bit different as you have the metadata to name the folder from. If I understand you correct, I think this can be solved by using the Inject Job element.
Create a folder containing the desired folder structure. Eg. a folder called "Topfolder" containing Folder_1, Folder_2 etc. and maybe some subfolders. Rename the incoming file using the metadata. Now use a copy of this file to trigger the injection of the folder containing the folder structure. When injecting the folder make sure to rename it after the incoming job (If that job has an extension, you will end up with a folder with an extension, which you have to remove using Rename Job).
On the original file (the one you didn't use for the injection) set the Hierarchy Path to be the Jobname Proper. Now direct both files to an Archive Hierarchy. You need to make sure that the new folder structure is in the Archiver Hierarchy before the file comes in. I suggest you simply put the file on hold for a few seconds to ensure that. There might be better ways?
It could all look something like this: As always with Switch there are probably other ways to achieve the same
-
- Member
- Posts: 93
- Joined: Fri Jul 08, 2011 10:31 am
- Location: The Netherlands
Re: Using variables in filepath
Hi Terkelsen,
Could you provide a sample of the folder-structure you need?
Could you provide a sample of the folder-structure you need?
Re: Using variables in filepath
Hi Terkelsen.
Could this work?
In the set Set hieararchy path you set the number of subfolders you need, the first one based on the Customer name and then in the Archive hierarchy you set the path to the folder before your customer folder.
See attached screenshot where the path set in Archive points to //Volumes/huvudserver/poffordrar (basically the folder in which your customer folders reside).
In the Set hierarchy path I then use the file name to create the next three folder levels and then finally I have a specific folder name for the original files submitted for the job.
In your case Path segment 1 would be where you put the customer name.
Could this work?
In the set Set hieararchy path you set the number of subfolders you need, the first one based on the Customer name and then in the Archive hierarchy you set the path to the folder before your customer folder.
See attached screenshot where the path set in Archive points to //Volumes/huvudserver/poffordrar (basically the folder in which your customer folders reside).
In the Set hierarchy path I then use the file name to create the next three folder levels and then finally I have a specific folder name for the original files submitted for the job.
In your case Path segment 1 would be where you put the customer name.
- Attachments
-
- Hieararchy.jpg (125.71 KiB) Viewed 12952 times
Enfocus Switch, Enfocus PitStop Server, Enfocus PDF Review, HP SmartStream& Kodak Prinergy with RBA
Offset 72x102, Offset Large Format, Digital Large Format and Digital print.
Offset 72x102, Offset Large Format, Digital Large Format and Digital print.
Re: Using variables in filepath
@Terkelsen
You rock! It works and you elevated my knowledge a ton in figuring it all out!
Thank you,
Sam
You rock! It works and you elevated my knowledge a ton in figuring it all out!
Thank you,
Sam
Re: Using variables in filepath
Hi Terkelsen,
Did you ever manage to get anywhere with making the filepath using variables or some kind of work around?
Thanks
Did you ever manage to get anywhere with making the filepath using variables or some kind of work around?
Thanks