hierarchy path
hierarchy path
Hi,
how can use hierarchy path with three first digit (is the page number) of file for download on the good folder match?!!
101_CAT2016_CLUB_FRNET.pdf ------> CAT16_CX_ANDET_MachineConsumables_100-118
102_CAT2016_CLUB_FRNET.pdf ------> CAT16_CX_ANDET_MachineConsumables_100-118
228_CAT2016_CLUB_FRNET.pdf ------> CAT16_CX_ANNET_OfficeSupplies_209-262
229_CAT2016_CLUB_FRNET.pdf ------> CAT16_CX_ANNET_OfficeSupplies_209-262
Help Thank!!
how can use hierarchy path with three first digit (is the page number) of file for download on the good folder match?!!
101_CAT2016_CLUB_FRNET.pdf ------> CAT16_CX_ANDET_MachineConsumables_100-118
102_CAT2016_CLUB_FRNET.pdf ------> CAT16_CX_ANDET_MachineConsumables_100-118
228_CAT2016_CLUB_FRNET.pdf ------> CAT16_CX_ANNET_OfficeSupplies_209-262
229_CAT2016_CLUB_FRNET.pdf ------> CAT16_CX_ANNET_OfficeSupplies_209-262
Help Thank!!
Re: hierarchy path
I'm not quite sure what you mean.
Do you want to move e.g. the file 101_CAT2016_CLUB_FRNET.pdf to folder CAT16_CX_ANDET_MachineConsumables_100-118?
And due to 101 in the filename, it is in range 100-118 and needs to be moved to that folder? Correct?
Do you want to move e.g. the file 101_CAT2016_CLUB_FRNET.pdf to folder CAT16_CX_ANDET_MachineConsumables_100-118?
And due to 101 in the filename, it is in range 100-118 and needs to be moved to that folder? Correct?
Part of my playground:
- HP Indigo 10k, HP Indigo 7600's (full options), Highcon Euclid III, Zünd S3
- HP Production Pro 6.0.1, HP Production Center 2.5.1 beta, Apogee 9.1, Enfocus Switch 13u1 & PitStop Server 13u2.
Chat: open-automation @ gitter
- HP Indigo 10k, HP Indigo 7600's (full options), Highcon Euclid III, Zünd S3
- HP Production Pro 6.0.1, HP Production Center 2.5.1 beta, Apogee 9.1, Enfocus Switch 13u1 & PitStop Server 13u2.
Chat: open-automation @ gitter
Re: hierarchy path
Is there a way to indentify the destination folder, is it somehow attached as metadata to the file?
If not, I'll go for a script expression in your path segment, which will check if the first 3 digits in the filename are 101 to 118 then set path segment to CAT16_CX_ANDET_MachineConsumables_100-118, if 228-262 set to CAT16_CX_ANNET_OfficeSupplies_209-262 etc.
But, in my opinion, this is only good manageable if these folders don't change (e.g. for every order) and there's not a couple of 100 of them.
If not, I'll go for a script expression in your path segment, which will check if the first 3 digits in the filename are 101 to 118 then set path segment to CAT16_CX_ANDET_MachineConsumables_100-118, if 228-262 set to CAT16_CX_ANNET_OfficeSupplies_209-262 etc.
But, in my opinion, this is only good manageable if these folders don't change (e.g. for every order) and there's not a couple of 100 of them.
Part of my playground:
- HP Indigo 10k, HP Indigo 7600's (full options), Highcon Euclid III, Zünd S3
- HP Production Pro 6.0.1, HP Production Center 2.5.1 beta, Apogee 9.1, Enfocus Switch 13u1 & PitStop Server 13u2.
Chat: open-automation @ gitter
- HP Indigo 10k, HP Indigo 7600's (full options), Highcon Euclid III, Zünd S3
- HP Production Pro 6.0.1, HP Production Center 2.5.1 beta, Apogee 9.1, Enfocus Switch 13u1 & PitStop Server 13u2.
Chat: open-automation @ gitter
Re: hierarchy path
the best solution is the script expression but i don't no create the script!? can you with the script?
Re: hierarchy path
Use this as your script expression in your Set hierarchy path;

Result:

Hope it helps,

Code: Select all
// Set first three charachters of jobName as variable pageNumber
var pageNumber = job.getVariableAsNumber("[Job.Name:Segment=\"1-3\"]");
// Default path is Unknown, in case of non defined
var hierarchyPath = "Unknown";
switch (true) {
case (pageNumber >= 100 && pageNumber <= 118): // Check if pageNumber is equal or greater than 100, and equal or less than 118
hierarchyPath = "CAT16_CX_ANDET_MachineConsumables_100-118"; // Set path to CAT16_CX_ANDET_MachineConsumables_100-118
break;
case (pageNumber >= 209 && pageNumber <= 262): // Same here, check if pageNumber is equal or greater than 209, and equal or less than 262
hierarchyPath = "CAT16_CX_ANNET_OfficeSupplies_209-262"; // Set path to CAT16_CX_ANNET_OfficeSupplies_209-262
break;
}
hierarchyPath;

Hope it helps,
Part of my playground:
- HP Indigo 10k, HP Indigo 7600's (full options), Highcon Euclid III, Zünd S3
- HP Production Pro 6.0.1, HP Production Center 2.5.1 beta, Apogee 9.1, Enfocus Switch 13u1 & PitStop Server 13u2.
Chat: open-automation @ gitter
- HP Indigo 10k, HP Indigo 7600's (full options), Highcon Euclid III, Zünd S3
- HP Production Pro 6.0.1, HP Production Center 2.5.1 beta, Apogee 9.1, Enfocus Switch 13u1 & PitStop Server 13u2.
Chat: open-automation @ gitter
Re: hierarchy path
WOW its work and with this sample script enlighten me in my learning!! thank!
Re: hierarchy path
No problem, glad I could help you out!
Part of my playground:
- HP Indigo 10k, HP Indigo 7600's (full options), Highcon Euclid III, Zünd S3
- HP Production Pro 6.0.1, HP Production Center 2.5.1 beta, Apogee 9.1, Enfocus Switch 13u1 & PitStop Server 13u2.
Chat: open-automation @ gitter
- HP Indigo 10k, HP Indigo 7600's (full options), Highcon Euclid III, Zünd S3
- HP Production Pro 6.0.1, HP Production Center 2.5.1 beta, Apogee 9.1, Enfocus Switch 13u1 & PitStop Server 13u2.
Chat: open-automation @ gitter
Re: hierarchy path
Hm, somehow I copied a slightly different code as I wanted it to be.
Added default: in the switch case, so it defaults the 'correct' way.
Code: Select all
// Set first three charachters of jobName as variable pageNumber
var pageNumber = job.getVariableAsNumber("[Job.Name:Segment=\"1-3\"]");
var hierarchyPath;
switch (true) {
case (pageNumber >= 100 && pageNumber <= 118): // Check if pageNumber is equal or greater then 100, and equal or less then 118
hierarchyPath = "CAT16_CX_ANDET_MachineConsumables_100-118"; // Set path to CAT16_CX_ANDET_MachineConsumables_100-118
break;
case (pageNumber >= 209 && pageNumber <= 262): // Same here, check if pageNumber is equal or greater then 209, and equal or less then 262
hierarchyPath = "CAT16_CX_ANNET_OfficeSupplies_209-262"; // Set path to CAT16_CX_ANNET_OfficeSupplies_209-262
break;
default:
hierarchyPath = "Unknown"; // Default path is Unknown, in case of non defined
break;
}
hierarchyPath;
Part of my playground:
- HP Indigo 10k, HP Indigo 7600's (full options), Highcon Euclid III, Zünd S3
- HP Production Pro 6.0.1, HP Production Center 2.5.1 beta, Apogee 9.1, Enfocus Switch 13u1 & PitStop Server 13u2.
Chat: open-automation @ gitter
- HP Indigo 10k, HP Indigo 7600's (full options), Highcon Euclid III, Zünd S3
- HP Production Pro 6.0.1, HP Production Center 2.5.1 beta, Apogee 9.1, Enfocus Switch 13u1 & PitStop Server 13u2.
Chat: open-automation @ gitter
Re: hierarchy path
That's an interesting use of a switch statement. Any reason you don't use an if/else?
Code: Select all
var pageNumber = job.getVariableAsNumber("[Job.Name:Segment=\"1-3\"]");
var hierarchyPath = "Unknown";
if (pageNumber >= 100 && pageNumber <= 118)
hierarchyPath = "CAT16_CX_ANDET_MachineConsumables_100-118";
else if (pageNumber >= 209 && pageNumber <= 262)
hierarchyPath = "CAT16_CX_ANDET_MachineConsumables_100-118";
hierarchyPath;
Re: hierarchy path
Not really, based on my experience so far.
My Switch experience, and with that Javascript / Switch scripting, is nearly over a year by now. Once when I had to do a compare with like 10 values I came up with the thoughts it is not efficient to check e.g. 9 if's before I reach if 10. That's why I used switch. It looked faster to me, however since I am learning through reading the manual and minimalize Googling scripting solutions it might not be the best way.
So all based on my own logic, and with this topic issue I notice, by automatism, I go with switch right away. If, else if, it doesn't sound bad in this case haha.
In this particular case, the only other thing I can lie off; I think it's better readable
My Switch experience, and with that Javascript / Switch scripting, is nearly over a year by now. Once when I had to do a compare with like 10 values I came up with the thoughts it is not efficient to check e.g. 9 if's before I reach if 10. That's why I used switch. It looked faster to me, however since I am learning through reading the manual and minimalize Googling scripting solutions it might not be the best way.
So all based on my own logic, and with this topic issue I notice, by automatism, I go with switch right away. If, else if, it doesn't sound bad in this case haha.
In this particular case, the only other thing I can lie off; I think it's better readable

Part of my playground:
- HP Indigo 10k, HP Indigo 7600's (full options), Highcon Euclid III, Zünd S3
- HP Production Pro 6.0.1, HP Production Center 2.5.1 beta, Apogee 9.1, Enfocus Switch 13u1 & PitStop Server 13u2.
Chat: open-automation @ gitter
- HP Indigo 10k, HP Indigo 7600's (full options), Highcon Euclid III, Zünd S3
- HP Production Pro 6.0.1, HP Production Center 2.5.1 beta, Apogee 9.1, Enfocus Switch 13u1 & PitStop Server 13u2.
Chat: open-automation @ gitter