Hi,
	I try to make a flow than clean temporary mac's files.
	I put inside a folder or structure folders inside files.
	Like this example
	folder1: 
	    .ds_store (temporary mac's file)
	    ._dile.indd (temporary mac's file)
	    file.indd, 
	    file2.indd
	    folder2:
	           file3.pdf
	           file4.xls
	
	I want to get up this result:
	folder1:
	     file.zip (file.indd and file2.indd)
	     folder2.zip (this if is posible else together in one file)
	
	First I use job dismantler:
	      -Subfolder: 99
	      -Attach hierarchy info: yes
	      -Add job folder name: yes
	      -Include subfolder level: 1
	      -Save top subfolders: yes
	
	and in assemble job put:
	      -Scheme: ungroup job
	            -Private data key: ungroup
	            -Numbers of file: automatic
	      -Merge data: yes
	      -Job Folder name: single line...[Job.Hierarchy:Index=1]
	      -Strip unique name: yes
	
	My problem is that when assemble job give me all file without the folder1, delete the temporary files.
	I don´t know what i make bad. Could you help me please? or if you have other posibility to keep off temporary mac´s files, perhaps it´s valid for me.
	Thanks, best regards.
	Miguel
			
			
									
						
										
						JobDismantler-Assemblejob
- 
				dkelly
 - TOP CONTRIBUTOR
 - Posts: 658
 - Joined: Mon Nov 29, 2010 8:45 pm
 - Location: Alpharetta GA USA
 - Contact:
 
JobDismantler-Assemblejob
Hello, try this simple script. It monitors a directory and deletes the Mac resource files. There are no input or output connections.
	
// Cleanup Mac resource files
//
// Written by Dwight Kelly <dkelly@apago.com>
// Copyright 2012 by Apago, Inc. -- All Rights Reserved
	
const cLogInfo = 1;
const cLogError = 3;
	
function timerFired( s : Switch )
{
var interval = s.getPropertyValue("interval");
if (interval > 0)
s.setTimerInterval(interval);
	
var theDirName = s.getPropertyValue("theDirName");
var theDir = new Dir(theDirName);
if (theDir.exists) {
var entries = theDir.entryList("*.*", Dir.All|Dir.System|Dir.Hidden, Dir.Unsorted);
for (var i = 0; i < entries.length; i++) {
var fileName = entries;
if (fileName == ".DS_Store" || fileName.left(2) == "._") {
var theFile = new File(theDirName + "/" + fileName);
s.log(cLogInfo, "Deleting " + fileName);
theFile.remove();
}
}
} else s.log(cLogError, "Error accessing directory: " + theDirName);
}
	
Dwight Kelly
Apago, Inc.
dkelly@apago.com
			
			
									
						
										
						// Cleanup Mac resource files
//
// Written by Dwight Kelly <dkelly@apago.com>
// Copyright 2012 by Apago, Inc. -- All Rights Reserved
const cLogInfo = 1;
const cLogError = 3;
function timerFired( s : Switch )
{
var interval = s.getPropertyValue("interval");
if (interval > 0)
s.setTimerInterval(interval);
var theDirName = s.getPropertyValue("theDirName");
var theDir = new Dir(theDirName);
if (theDir.exists) {
var entries = theDir.entryList("*.*", Dir.All|Dir.System|Dir.Hidden, Dir.Unsorted);
for (var i = 0; i < entries.length; i++) {
var fileName = entries;
if (fileName == ".DS_Store" || fileName.left(2) == "._") {
var theFile = new File(theDirName + "/" + fileName);
s.log(cLogInfo, "Deleting " + fileName);
theFile.remove();
}
}
} else s.log(cLogError, "Error accessing directory: " + theDirName);
}
Dwight Kelly
Apago, Inc.
dkelly@apago.com
- 
				mcolmenero
 - Newbie
 - Posts: 19
 - Joined: Tue Feb 14, 2012 12:18 pm
 
JobDismantler-Assemblejob
Hi Dwight Kelly,
sorry for my late answer. I have been on hollidays.
Thanks for your help, but I put a structure folders. And my problem is when It assemblejob is not do good. It no assembles like the same I put inside.
And your script is not looking for all structure.
Thanks.
Best regards
			
			
									
						
										
						sorry for my late answer. I have been on hollidays.
Thanks for your help, but I put a structure folders. And my problem is when It assemblejob is not do good. It no assembles like the same I put inside.
And your script is not looking for all structure.
Thanks.
Best regards
- 
				mcolmenero
 - Newbie
 - Posts: 19
 - Joined: Tue Feb 14, 2012 12:18 pm
 
JobDismantler-Assemblejob
hi Dwight,
But what need i to write with s.getPropertyValue("theDirName") and s.getPropertyValue("interval")? I need to define these variables?
Because I can´t put swich on the flow.
I make a flow with:
folder in - your script - folder out
The log flow says me "28/06/2012 12:55:59,Error,SwitchScript0,New flow,SwitchScript0,008UW,Grupo Mejora,Requested property is not defined: 'theDirName'; trying to use default value"
I put inside folder structure folder and files, but no go on. What need i to go on?
			
			
									
						
										
						But what need i to write with s.getPropertyValue("theDirName") and s.getPropertyValue("interval")? I need to define these variables?
Because I can´t put swich on the flow.
I make a flow with:
folder in - your script - folder out
The log flow says me "28/06/2012 12:55:59,Error,SwitchScript0,New flow,SwitchScript0,008UW,Grupo Mejora,Requested property is not defined: 'theDirName'; trying to use default value"
I put inside folder structure folder and files, but no go on. What need i to go on?
- 
				dkelly
 - TOP CONTRIBUTOR
 - Posts: 658
 - Joined: Mon Nov 29, 2010 8:45 pm
 - Location: Alpharetta GA USA
 - Contact:
 
JobDismantler-Assemblejob
You either need to add properties for "theDirName" and "interval" in Scripter or set them to a fixed value in the script.
	
var interval = 86400; // every 24 hours
s.setTimerInterval(interval);
var theDirName = "/Volumes/BigServer/Path/To/Cleanup";
			
			
									
						
										
						var interval = 86400; // every 24 hours
s.setTimerInterval(interval);
var theDirName = "/Volumes/BigServer/Path/To/Cleanup";