[OS X TeX] Delete all processing files

Themis Matsoukas matsoukas at psu.edu
Wed Feb 22 19:40:31 EST 2006


On Feb 22, 2006, at 6:11 PM, Friedrich Vosberg wrote:

> I want to delete automatically [...] after typestting a document

This would not work because latex needs .aux files between  
consecutive runs

> or by one click all files except for the tex file and the pdf file  
> after typestting a document. I think the best way would be a button  
> in the pdf preview window of TeXShop to approach that purpose,  
> isn't it?

This can be done with applescript, either in stand-alone form, or  
activated via texshop. Here is the script that I have been using  
(this is a standalone version but should be easy to modify to run  
from inside texshop):

----------

(*This script cleans up tex clutter; it acts recursively on all  
folders inside the selected folder.
Original Script by Themis Matsoukas; Recursive code by Jean-Claude DE  
SOZA *)

(* the on-run handler is activated when the icon of the script is  
double-cicked *)

on run
	set my_folder to (choose folder with prompt "Please choose a  
folder") as alias
	GoCleanUp(my_folder)
end run

(* the on-open handler is activated when a folder is dropped onto the  
script icon *)
on open (drop_folder)
	set my_folder to drop_folder as alias
	GoCleanUp(my_folder)
end open

(* this handler does the actual job *)
on GoCleanUp(my_folder)
	tell application "Finder"
		delete (every file of my_folder whose name ends with ".aux")
		delete (every file of my_folder whose name ends with ".log")
		delete (every file of my_folder whose name ends with ".toc")
		delete (every file of my_folder whose name ends with ".out")
		delete (every file of my_folder whose name ends with ".pdfsync")
		delete (every file of my_folder whose name ends with ".tui")
		delete (every file of my_folder whose name ends with ".top")
		delete (every file of my_folder whose name ends with ".tup")
		
		(* do the same with all folders inside the original folder*)
		set myFolderList to (every folder of my_folder)
		repeat with myFolder in myFolderList
			my GoCleanUp(myFolder)
		end repeat
		
	end tell
end GoCleanUp
------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the MacOSX-TeX mailing list